Skip to content
/ Rra Public

R version implementation of the reduced-rank approach by Dashan Huang et al. (MS, 2022)

License

Notifications You must be signed in to change notification settings

hnmei/Rra

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rra

R version implementation of the reduced-rank approach by Dashan Huang et al. (MS, 2022)

Install

library(devtools)
devtools::install_github("hnmei/Rra")

Data

We provide two data sets:

"48_ports_ret_74-16.Rdata": 48 industry portfolios (516*49 dataframe, the added one is date) as the example input of return data.

"70_factor_proxies_74-16.Rdata": 70 factor proxies (516*71 dataframe, the added one is date) as the example input of factors.

date column is needed and if you use your own data, notice that put the date column at the first column.

Usage

# load dependent pkg
library(expm)
library(POET)
library(Rra)

data("48_ports_ret_74-16") # return data of basis portfolios
data("70_factor_proxies_74-16") # factor proxies
rra <- rra(ff48, factor_proxies, 5)

RRA with price restriction

The dafault price error(alpha) per year is 1%, adjusted with standard error of each portfolio automatically.

rra_pere <- rra(ff48, factor_proxies, 5, price_error=TRUE)

Also, you can define alpha yourself, like with 5% price error per year:

rra_pere <- rra(
    ff48, factor_proxies, 5, 
    price_error=TRUE, alpha=5
)

RRA with changing weight

We estimate the weight matrix (S2) with the method of with the principal orthogonal complement thresholding method of Fan, Liao, and Mincheva (2013). The R code implementation can refer to R package POET. The weight matrix is estimated automatically.

rra_w <- rra(
    ff48, factor_proxies, 5
    weight=TRUE
)

References

  1. Dashan Huang et al. (MS 2022) Shrinking Factor Dimension A Reduced-Rank Approach
  2. Fan, J., Liao, Y., Mincheva, M., 2013. Large covariance estimation by thresholding principal orthogonal complements. Journal of the Royal Statistical Society. Series B (Statistical Methodology) 75, 603–680.

About

R version implementation of the reduced-rank approach by Dashan Huang et al. (MS, 2022)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages