Author: Alberto Quaini

Efficient implementation of the sample and Oracle tradable factor risk premia estimators based on the methods developed in A. Quaini, F. Trojani and M. Yuan (2023) Tradable Factor Risk Premia and Oracle Tests of Asset Pricing Models.

Package `intrinsicFRP`

is on CRAN (The Comprehensive R
Archive Network), hence the latest release can be easily installed from
the `R`

command line via

`install.packages("intrinsicFRP")`

To install the latest (possibly unstable) development version from
GitHub, you can pull this repository and install it from the
`R`

command line via

```
# if you already have package `devtools` installed, you can skip the next line
install.packages("devtools")
::install_github("a91quaini/intrinsicFRP") devtools
```

Package `intrinsicFRP`

contains `C++`

code that
needs to be compiled, so you may need to download and install the necessary tools for
MacOS or the necessary tools
for Windows.

`TFRP()`

[Prevously:`IFRP`

]: Computes tradable factor risk premia from data on factors and test asset excess returns. Optionally computes the corresponding heteroskedasticity and autocorrelation robust standard errors using the Newey-West (1994) plug-in procedure to select the number of relevant lags, i.e.,`n_lags = 4 * (n_observations/100)^(2/9)`

.`OracleTFRP()`

[Prevously:`OptimalAdaptiveIFRP`

]: Computes optimal Oracle tradable factor risk premia for various penalty parameter values from data on factors and test asset excess returns. Tuning is performed via Generalized Cross Validation (GCV), Cross Validation (CV) or Rolling Validation (RV). Adaptive weights are based on the correlation between factors and returns, on the regression coefficients of returns on factors or on the first-step intrinsic risk premia estimator. Optionally computes the corresponding heteroskedasticity and autocorrelation robust standard errors using the Newey-West (1994) plug-in procedure to select the number of relevant lags, i.e.,`n_lags = 4 * (n_observations/100)^(2/9)`

.`FRP()`

: Computes Fama MachBeth (1973) or misspecification-robust factor risk premia of Kan Robotti Shanken (2013) from data on factors and test asset excess returns. Optionally computes the corresponding heteroskedasticity and autocorrelation robust standard errors using the Newey-West (1994) plug-in procedure to select the number of relevant lags, i.e.,`n_lags = 4 * (n_observations/100)^(2/9)`

.`ChenFang2019BetaRankTest()`

: Computes the Chen fang 2019 rank statistic and p-value of the null that the matrix of regression loadings of test asset excess returns on risk factors has reduced rank.`HJMisspecificationTest()`

: Computes the Hansen-Jagannatan misspecification statistic and p-value of an asset pricing model from test asset excess returns and risk factors.

For usage details, type `?FunctionName`

in the R console,
e.g.:

` ?TFRP`

Compute risk premia estimates and corresponding standard errors:

```
# import package data on 6 risk factors and 42 test asset excess returns
= intrinsicFRP::factors[,c(2,3,4)]
factors = intrinsicFRP::returns[,-1]
returns
# simulate a useless factor and add it to the matrix of factors
set.seed(23)
= cbind(factors, stats::rnorm(nrow(factors), sd = stats::sd(factors[,1])))
factors colnames(factors) = c(colnames(intrinsicFRP::factors[,c(2,3,4)]), "Usless")
# compute tradable factor risk premia and their standard errors
= TFRP(returns, factors, include_standard_errors = TRUE)
tfrp
# compute the GLS factor risk premia of Kan Robotti and Shanken (2013) and their
# standard errors
= FRP(returns, factors, include_standard_errors = TRUE)
krs_frp
# set penalty parameters
= seq(1e-4, 1e-2, length.out = 1000)
penalty_parameters
# compute Oracle tradable factor risk premia and their standard errors
= OracleTFRP(
oracle_tfrp
returns,
factors,
penalty_parameters,include_standard_errors = TRUE,
)
```

Oracle TFRP model score:

Compare risk premia estimates of misspecification-robust factor risk premia (KRS), tradable factor risk premia (TFRP) and Oracle TFRP (O-TFRP):

Quaini, A., Trojani, F. and Yuan, M., 2023. Tradable Factor Risk Premia and Oracle Tests of Asset Pricing Models.

Kan, R., Robotti, C. and Shanken, J., 2013. Pricing model performance and the two‐pass cross‐sectional regression methodology. The Journal of Finance, 68(6), pp.2617-2649.

Fama, E.F. and MacBeth, J.D., 1973. Risk, return, and equilibrium: Empirical tests. Journal of political economy, 81(3), pp.607-636.