Package FinCovRegularization

Similar documents
Package reinforcedpred

Package varband. November 7, 2016

Package SK. May 16, 2018

Package depth.plot. December 20, 2015

Package polypoly. R topics documented: May 27, 2017

Package HIMA. November 8, 2017

Package gtheory. October 30, 2016

Package invgamma. May 7, 2017

Package covsep. May 6, 2018

Package jmcm. November 25, 2017

Package RTransferEntropy

Package xdcclarge. R topics documented: July 12, Type Package

Package Tcomp. June 6, 2018

Package MultisiteMediation

Package SimSCRPiecewise

Package ShrinkCovMat

Package thief. R topics documented: January 24, Version 0.3 Title Temporal Hierarchical Forecasting

Package BNN. February 2, 2018

Package EMVS. April 24, 2018

Package SCEPtERbinary

Package matrixnormal

Package hds. December 31, 2016

Package gwqs. R topics documented: May 7, Type Package. Title Generalized Weighted Quantile Sum Regression. Version 1.1.0

Package icmm. October 12, 2017

Package bigtime. November 9, 2017

Package effectfusion

Package supernova. February 23, 2018

Package flexcwm. R topics documented: July 11, Type Package. Title Flexible Cluster-Weighted Modeling. Version 1.0.

Package sbgcop. May 29, 2018

Package robustrao. August 14, 2017

Package sscor. January 28, 2016

Package bivariate. December 10, 2018

Package asus. October 25, 2017

Package flexcwm. R topics documented: July 2, Type Package. Title Flexible Cluster-Weighted Modeling. Version 1.1.

Package cartogram. June 21, 2018

Package scpdsi. November 18, 2018

Package factorqr. R topics documented: February 19, 2015

Package locfdr. July 15, Index 5

Package ebal. R topics documented: February 19, Type Package

Package TwoStepCLogit

Package CPE. R topics documented: February 19, 2015

Package dhga. September 6, 2016

Package EnergyOnlineCPM

Package horseshoe. November 8, 2016

Package MicroMacroMultilevel

Package scio. February 20, 2015

Package gk. R topics documented: February 4, Type Package Title g-and-k and g-and-h Distribution Functions Version 0.5.

Package stability. R topics documented: August 23, Type Package

Package convospat. November 3, 2017

Package NonpModelCheck

Package generalhoslem

Package SPreFuGED. July 29, 2016

Package nardl. R topics documented: May 7, Type Package

Package Grace. R topics documented: April 9, Type Package

Package RATest. November 30, Type Package Title Randomization Tests

Package msu. September 30, 2017

Package spcov. R topics documented: February 20, 2015

Package OGI. December 20, 2017

Package esreg. August 22, 2017

Package noncompliance

Package R1magic. August 29, 2016

Package RSwissMaps. October 3, 2017

Package nowcasting. April 25, Type Package

Package SMFilter. December 12, 2018

Package aspi. R topics documented: September 20, 2016

Package cvequality. March 31, 2018

Package rgabriel. February 20, 2015

Package MAPA. R topics documented: January 5, Type Package Title Multiple Aggregation Prediction Algorithm Version 2.0.4

Package TimeSeries.OBeu

Package rdefra. March 20, 2017

Package beam. May 3, 2018

Package timelines. August 29, 2016

Package baystability

Package TSPred. April 5, 2017

Package AID. R topics documented: November 10, Type Package Title Box-Cox Power Transformation Version 2.3 Date Depends R (>= 2.15.

Package coop. November 14, 2017

Package ltsbase. R topics documented: February 20, 2015

Package TSF. July 15, 2017

Package netdep. July 10, 2018

Package GD. January 12, 2018

Package clogitboost. R topics documented: December 21, 2015

Package leiv. R topics documented: February 20, Version Type Package

Package netcoh. May 2, 2016

Package LIStest. February 19, 2015

Package Select. May 11, 2018

Package MTA. R topics documented: May 14, Title Multiscalar Territorial Analysis Version 0.1.2

Package SimCorMultRes

Package r2glmm. August 5, 2017

Package NlinTS. September 10, 2018

Package rarhsmm. March 20, 2018

Package kgc. December 21, Version Date Title Koeppen-Geiger Climatic Zones

Package rarpack. August 29, 2016

Package SpatialPack. March 20, 2018

Package funrar. March 5, 2018

Package pfa. July 4, 2016

Package metafuse. October 17, 2016

Package STMedianPolish

Package goftest. R topics documented: April 3, Type Package

Package ForwardSearch

Package darts. February 19, 2015

Transcription:

Type Package Package FinCovRegularization April 25, 2016 Title Covariance Matrix Estimation and Regularization for Finance Version 1.1.0 Estimation and regularization for covariance matrix of asset returns. For covariance matrix estimation, three major types of factor models are included: macroeconomic factor model, fundamental factor model and statistical factor model. For covariance matrix regularization, four regularized estimators are included: banding, tapering, hard-thresholding and softthresholding. The tuning parameters of these regularized estimators are selected via cross-validation. URL http://github.com/yanyachen/fincovregularization BugReports http://github.com/yanyachen/fincovregularization/issues Depends R (>= 2.10) Imports stats, graphics, quadprog License GPL-2 LazyData true RoxygenNote 5.0.1 NeedsCompilation no Author YaChen Yan [aut, cre], FangZhu Lin [aut] Maintainer YaChen Yan <yanyachen21@gmail.com> Repository CRAN Date/Publication 2016-04-25 15:32:07 R topics documented: banding........................................... 2 banding.cv.......................................... 3 F.norm2........................................... 4 FinCovRegularization.................................... 4 1

2 banding FundamentalFactor.Cov................................... 5 GMVP............................................ 5 hard.thresholding...................................... 6 Ind.Cov........................................... 7 m.excess.c10sp9003.................................... 7 MacroFactor.Cov...................................... 8 O.norm2........................................... 8 RiskParity.......................................... 9 soft.thresholding...................................... 9 StatFactor.Cov........................................ 10 tapering........................................... 11 tapering.cv......................................... 11 threshold.cv......................................... 13 Index 15 banding Banding Opreator on Covariance Matrix Apply banding operator on a covariance matrix with a banding parameter. banding(sigma, k = 0) sigma k a p*p covariance matrix banding parameter a regularized covariance matrix after banding operation References "High-Dimensional Covariance Estimation" by Mohsen Pourahmadi cov.sam <- cov(m.excess.c10sp9003) banding(cov.sam, 7)

banding.cv 3 banding.cv Select Tuning Parameter for Banding Covariance Matrix by CV Apply K-fold cross-validation for selecting tuning parameters for banding covariance matrix using grid search strategy banding.cv(matrix, n.cv = 10, norm = "F", seed = 142857) matrix a N*p matrix, N indicates sample size and p indicates the dimension n.cv times that cross-validation repeated, the default number is 10 norm the norms used to measure the cross-validation errors, which can be the Frobenius norm "F" or the operator norm "O" seed random seed, the default value is 142857 Details For cross-validation, this function split the sample randomly into two pieces of size n1 = n-n/log(n) and n2 = n/log(n), and repeat this k times An object of class "CovCv" containing the cross-validation s result for covariance matrix regularization, including: regularization regularization method, which is "Banding" parameter.opt cv.error n.cv norm seed selected optimal parameter by cross-validation the corresponding cross-validation errors times that cross-validation repeated the norm used to measure the cross-validation error random seed References "High-Dimensional Covariance Estimation" by Mohsen Pourahmadi

4 FinCovRegularization retcov.cv <- banding.cv(m.excess.c10sp9003, n.cv = 10, norm = "F", seed = 142857) summary(retcov.cv) plot(retcov.cv) # Low dimension F.norm2 The Squared Frobenius Norm Calculate the squared Frobenius norm of a matrix F.norm2(matrix) matrix a matrix a scalar of the squared Frobenius norm cov.sam <- cov(m.excess.c10sp9003) F.norm2(cov.SAM) FinCovRegularization FinCovRegularization: Covariance Matrix Estimation and Regularization for Finance Estimation and regularization for covariance matrix of asset returns. For covariance matrix estimation, three major types of factor models are included: macroeconomic factor model, fundamental factor model and statistical factor model. For covariance matrix regularization, four regularized estimators are included: banding, tapering, hard-thresholding and soft-thresholding. The tuning parameters of these regularized estimators are selected via cross-validation.

FundamentalFactor.Cov 5 FundamentalFactor.Cov Covariance Matrix Estimation by Fundamental Factor Model Estimate covariance matrix by fitting a fundamental factor model using OLS or WLS regression FundamentalFactor.Cov(assets, exposure, method = "WLS") assets exposure method a N*p matrix of asset returns, N indicates sample size and p indicates the dimension of asset returns a p*q matrix of exposure indicator for the fundamental factor model, p corresponds to the dimension of asset returns, q indicates the number of fundamental industries a character, indicating regression method: "OLS" or "WLS" an estimated p*p covariance matrix assets <- m.excess.c10sp9003[,1:10] Indicator <- matrix(0,10,3) dimnames(indicator) <- list(colnames(assets),c("drug","auto","oil")) Indicator[c("ABT","LLY","MRK","PFE"),"Drug"] <- 1 Indicator[c("F","GM"),"Auto"] <- 1 Indicator[c("BP","CVX","RD","XOM"),"Oil"] <- 1 FundamentalFactor.Cov(assets,exposure=Indicator,method="WLS") GMVP Global Minimum Variance Portfolio Computing a global minimum variance portfolio weights from the estimated covariance matrix of return series. GMVP(cov.mat, short = TRUE)

6 hard.thresholding cov.mat short an estimated p*p covariance matrix logical flag, indicating whether shortsales on the risky assets are allowed a numerical vector containing the estimated portfolio weights assets <- m.excess.c10sp9003[,1:10] GMVP(cov(assets), short=true) GMVP(cov(assets), short=false) hard.thresholding Hard-Thresholding Opreator on Covariance Matrix Apply hard-thresholding operator on a covariance matrix with a hard-thresholding parameter. hard.thresholding(sigma, threshold = 0.5) sigma threshold a p*p covariance matrix hard-thresholding parameter a regularized covariance matrix after hard-thresholding operation References "High-Dimensional Covariance Estimation" by Mohsen Pourahmadi cov.sam <- cov(m.excess.c10sp9003) hard.thresholding(cov.sam, threshold = 0.001)

Ind.Cov 7 Ind.Cov Independence opreator on Covariance Matrix Apply independence model on a covariance matrix. Ind.Cov(sigma) sigma a covariance matrix a regularized covariance matrix after applying independence model cov.sam <- cov(m.excess.c10sp9003) Ind.Cov(cov.SAM) m.excess.c10sp9003 10 stock and S&P 500 excess returns A dataset containing monthly excess returns of 10 stocks and S$P 500 index return from January 1990 to December 2003 Format A matrix with 168 rows and 11 variables

8 O.norm2 MacroFactor.Cov Covariance Matrix Estimation by Macroeconomic Factor Model Estimate covariance matrix by fitting a macroeconomic factor model using time series regression MacroFactor.Cov(assets, factor) assets factor a N*p matrix of asset returns, N indicates sample size and p indicates the dimension of asset returns a numerical vector of length N, or a N*q matrix of macroeconomic factor(s), q indicates the dimension of factors an estimated p*p covariance matrix assets <- m.excess.c10sp9003[,1:10] factor <- m.excess.c10sp9003[,11] MacroFactor.Cov(assets, factor) O.norm2 The Squared Operator Norm Calculate the squared Operator norm of a matrix O.norm2(matrix) matrix a matrix a scalar of the squared Operator norm

RiskParity 9 cov.sam <- cov(m.excess.c10sp9003) O.norm2(cov.SAM) RiskParity Risk Parity Portfolio Computing a Risk Parity portfolio weights from the estimated covariance matrix of return series. RiskParity(cov.mat) cov.mat an estimated p*p covariance matrix a numerical vector containing the estimated portfolio weights assets <- m.excess.c10sp9003[,1:10] RiskParity(cov(assets)) soft.thresholding Soft-Thresholding Opreator on Covariance Matrix Apply soft-thresholding operator on a covariance matrix with a soft-thresholding parameter. soft.thresholding(sigma, threshold = 0.5) sigma threshold a covariance matrix soft-thresholding parameter

10 StatFactor.Cov a regularized covariance matrix after soft-thresholding operation References "High-Dimensional Covariance Estimation" by Mohsen Pourahmadi cov.sam <- cov(m.excess.c10sp9003) soft.thresholding(cov.sam, threshold = 0.001) StatFactor.Cov Covariance Matrix Estimation by Statistical Factor Model Estimate covariance matrix by fitting a statistical factor model using principle components analysis StatFactor.Cov(assets, k = 0) assets k a matrix of asset returns numbers of factors, if k = 0, automatically estimating by Kaiser method an estimated p*p covariance matrix assets <- m.excess.c10sp9003[,1:10] StatFactor.Cov(assets, 3)

tapering 11 tapering Tapering Opreator on Covariance Matrix Apply tapering operator on a covariance matrix with tapering parameters. tapering(sigma, l, h = 1/2) sigma l h a p*p covariance matrix tapering parameter the ratio between taper l_h and parameter l a regularized covariance matrix after tapering operation References "High-Dimensional Covariance Estimation" by Mohsen Pourahmadi cov.sam <- cov(m.excess.c10sp9003) tapering(cov.sam, l=7, h = 1/2) tapering.cv Select Tuning Parameter for Tapering Covariance Matrix by CV Apply K-fold cross-validation for selecting tuning parameters for tapering covariance matrix using grid search strategy tapering.cv(matrix, h = 1/2, n.cv = 10, norm = "F", seed = 142857)

12 tapering.cv matrix h a N*p matrix, N indicates sample size and p indicates the dimension the ratio between taper l_h and parameter l n.cv times that cross-validation repeated, the default number is 10 norm the norms used to measure the cross-validation errors, which can be the Frobenius norm "F" or the operator norm "O" seed random seed, the default value is 142857 Details For cross-validation, this function split the sample randomly into two pieces of size n1 = n-n/log(n) and n2 = n/log(n), and repeat this k times An object of class "CovCv" containing the cross-validation s result for covariance matrix regularization, including: regularization regularization method, which is "Tapering" parameter.opt cv.error n.cv norm seed selected optimal parameter by cross-validation the corresponding cross-validation errors times that cross-validation repeated the norm used to measure the cross-validation error random seed References "High-Dimensional Covariance Estimation" by Mohsen Pourahmadi retcov.cv <- tapering.cv(m.excess.c10sp9003, n.cv = 10, norm = "F", seed = 142857) summary(retcov.cv) plot(retcov.cv) # Low dimension

threshold.cv 13 threshold.cv Select Tuning Parameter for Thresholding Covariance Matrix by CV Apply K-fold cross-validation for selecting tuning parameters for thresholding covariance matrix using grid search strategy threshold.cv(matrix, method = "hard", thresh.len = 20, n.cv = 10, norm = "F", seed = 142857) matrix method thresh.len a N*p matrix, N indicates sample size and p indicates the dimension thresholding method, "hard" or "soft" the number of thresholding values tested in cross-validation, the thresholding values will be a sequence of thresh.len equally spaced values from minimum threshold constant to largest covariance in sample covariance matrix n.cv times that cross-validation repeated, the default number is 10 norm the norms used to measure the cross-validation errors, which can be the Frobenius norm "F" or the operator norm "O" seed random seed, the default value is 142857 Details For cross-validation, this function split the sample randomly into two pieces of size n1 = n-n/log(n) and n2 = n/log(n), and repeat this k times An object of class "CovCv" containing the cross-validation s result for covariance matrix regularization, including: regularization regularization method, which is "Hard Thresholding" or "Soft Thresholding" parameter.opt cv.error n.cv norm seed selected optimal parameter by cross-validation the corresponding cross-validation errors times that cross-validation repeated the norm used to measure the cross-validation error random seed threshold.grid thresholding values tested in cross-validation

14 threshold.cv References "High-Dimensional Covariance Estimation" by Mohsen Pourahmadi retcov.cv <- threshold.cv(m.excess.c10sp9003, method = "hard", thresh.len = 20, n.cv = 10, norm = "F", seed = 142857) summary(retcov.cv) plot(retcov.cv) # Low dimension

Index Topic datasets m.excess.c10sp9003, 7 banding, 2 banding.cv, 3 F.norm2, 4 FinCovRegularization, 4 FinCovRegularization-package (FinCovRegularization), 4 FundamentalFactor.Cov, 5 GMVP, 5 hard.thresholding, 6 Ind.Cov, 7 m.excess.c10sp9003, 7 MacroFactor.Cov, 8 O.norm2, 8 RiskParity, 9 soft.thresholding, 9 StatFactor.Cov, 10 tapering, 11 tapering.cv, 11 threshold.cv, 13 15