OracleTFRP {intrinsicFRP} | R Documentation |
Oracle tradable factor risk premia.
Description
Computes Oracle tradable factor risk premia of
Quaini-Trojani-Yuan (2023) doi:10.2139/ssrn.4574683 from data on
K
factors F = [F_1,...,F_K]'
and test asset excess returns R
:
OTFRP = argmin_x ||TFRP - x||_2^2 + tau * sum_{k=1}^K w_k * |x_k|
,
where TFRP
is the tradable factor risk premia estimator, tau > 0
is a
penalty parameter, and the Oracle weights are given by
w_k = 1 / ||corr[F_k, R]||_2^2
.
This estimator is called "Oracle" in the sense that the probability that
the index set of its nonzero estimated risk premia equals the index set of
the true strong factors tends to 1 (Oracle selection), and that on the strong
factors, the estimator reaches the optimal asymptotic Normal distribution.
Here, strong factors are those that have a nonzero population marginal
correlation with asset excess returns.
Tuning of the penalty parameter tau
is performed via Generalized Cross
Validation (GCV), Cross Validation (CV) or Rolling Validation (RV).
GCV tunes parameter tau
by minimizing the criterium:
||PE(tau)||_2^2 / (1-df(tau)/T)^2
where
PE(tau) = E[R] - beta_{S(tau)} * OTFRP(tau)
are the pricing errors of the model for given tuning parameter tau
,
with S(tau)
being the index set of the nonzero Oracle TFRP computed with
tuning parameter tau
, and
beta_{S(tau)} = Cov[R, F_{S(tau)}] * (Cov[F_{S(tau)}, R] * V[R]^{-1} * Cov[R, F_{S(tau)}])^{-1}
the regression coefficients of the test assets excess returns on the
factor mimicking portfolios,
and df(tau) = |S(tau)|
are the degrees of freedom of the model, given by the
number of nonzero Oracle TFRP.
CV and RV, instead, choose the value of tau
that minimize the criterium:
PE(tau)' * V[PE(tau)]^{-1} PE(tau)
where V[PE(tau)]
is the diagonal matrix collecting the marginal variances
of pricing errors PE(tau)
, and each of these components are
aggregated over k-fold cross-validated data or over rolling windows of data,
respectively.
Oracle weights can be based on the correlation between factors and returns
(suggested approach),
on the regression coefficients of returns on factors or on the first-step
tradable risk premia estimator. Optionally computes the corresponding
heteroskedasticity and autocorrelation robust standard errors using the
Newey-West (1994) doi:10.2307/2297912 plug-in procedure to select the number
of relevant lags, i.e., n_lags = 4 * (n_observations/100)^(2/9)
.
For the standard error computations, the function allows to internally
pre-whiten the series by fitting a VAR(1),
i.e., a vector autoregressive model of order 1.
All details are found in Quaini-Trojani-Yuan (2023) doi:10.2139/ssrn.4574683.
Usage
OracleTFRP(
returns,
factors,
penalty_parameters,
weighting_type = "c",
tuning_type = "g",
one_stddev_rule = TRUE,
gcv_scaling_n_assets = FALSE,
gcv_identification_check = FALSE,
target_level_kp2006_rank_test = 0.05,
n_folds = 5,
n_train_observations = 120,
n_test_observations = 12,
roll_shift = 12,
relaxed = FALSE,
include_standard_errors = FALSE,
hac_prewhite = FALSE,
plot_score = TRUE,
check_arguments = TRUE
)
Arguments
returns |
A |
factors |
A |
penalty_parameters |
A |
weighting_type |
A character specifying the type of adaptive weights:
based on the correlation between factors and returns |
tuning_type |
A character indicating the parameter tuning type:
|
one_stddev_rule |
A boolean: |
gcv_scaling_n_assets |
(only relevant for |
gcv_identification_check |
(only relevant for |
target_level_kp2006_rank_test |
(only relevant for |
n_folds |
(only relevant for |
n_train_observations |
(only relevant for |
n_test_observations |
(only relevant for |
roll_shift |
(only relevant for |
relaxed |
A boolean: |
include_standard_errors |
A boolean |
hac_prewhite |
A boolean indicating if the series needs prewhitening by
fitting an AR(1) in the internal heteroskedasticity and autocorrelation
robust covariance (HAC) estimation. Default is |
plot_score |
A boolean: |
check_arguments |
A boolean |
Value
A list containing the n_factors
-dimensional vector of adaptive
tradable factor risk premia in "risk_premia"
; the optimal penalty
parameter value in "penalty_parameter"
; the model score for each penalty
parameter value in "model_score"
; if include_standard_errors = TRUE
, then
it further includes n_factors
-dimensional vector of tradable factor risk
premia standard errors in "standard_errors"
.
Examples
# import package data on 6 risk factors and 42 test asset excess returns
factors = intrinsicFRP::factors[,-1]
returns = intrinsicFRP::returns[,-1]
penalty_parameters = seq(0., 1., length.out = 100)
# compute optimal adaptive tradable factor risk premia and their standard errors
oracle_tfrp = OracleTFRP(
returns,
factors,
penalty_parameters,
include_standard_errors = TRUE
)