intrinsicFRP: Oracle tradable factor risk premia

CRAN status License: GPL v3 R-CMD-check codecov

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.

Installation

Building from CRAN

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")

Building from source

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")
devtools::install_github("a91quaini/intrinsicFRP")

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.

Main functions:

For usage details, type ?FunctionName in the R console, e.g.:

?TFRP

Example

Compute risk premia estimates and corresponding standard errors:

# import package data on 6 risk factors and 42 test asset excess returns
factors = intrinsicFRP::factors[,c(2,3,4)]
returns = intrinsicFRP::returns[,-1]

# simulate a useless factor and add it to the matrix of factors
set.seed(23)
factors = cbind(factors, stats::rnorm(nrow(factors), sd = stats::sd(factors[,1])))
colnames(factors) = c(colnames(intrinsicFRP::factors[,c(2,3,4)]), "Usless")

# compute tradable factor risk premia and their standard errors
tfrp = TFRP(returns, factors, include_standard_errors = TRUE)

# compute the GLS factor risk premia of Kan Robotti and Shanken (2013) and their
# standard errors
krs_frp = FRP(returns, factors, include_standard_errors = TRUE)

# set penalty parameters
penalty_parameters = seq(1e-4, 1e-2, length.out = 1000)

# compute Oracle tradable factor risk premia and their standard errors
oracle_tfrp = OracleTFRP(
  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):

References

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.