calculates covariance, coskewness and cokurtosis matrices as structured estimators
M2.struct(R, struct = c("Indep", "IndepId", "observedfactor", "CC"), f = NULL) M3.struct(R, struct = c("Indep", "IndepId", "observedfactor", "CC", "latent1factor", "CS"), f = NULL, unbiasedMarg = FALSE, as.mat = TRUE) M4.struct(R, struct = c("Indep", "IndepId", "observedfactor", "CC"), f = NULL, as.mat = TRUE)
R | an xts, vector, matrix, data frame, timeSeries or zoo object of asset returns |
---|---|
struct | string containing the preferred method. See Details. |
f | vector or matrix with observations of the factor, to be used with 'observedfactor'. See Details. |
unbiasedMarg | TRUE/FALSE whether to use a correction to have an unbiased estimator for the marginal skewness values, in case of 'Indep' or 'IndepId', default FALSE |
as.mat | TRUE/FALSE whether to return the full moment matrix or only the vector with the unique elements (the latter is advised for speed), default TRUE |
The coskewness and cokurtosis matrices are defined as the matrices of dimension p x p^2 and p x p^3 containing the third and fourth order central moments. They are useful for measuring nonlinear dependence between different assets of the portfolio and computing modified VaR and modified ES of a portfolio.
Structured estimation is based on the assumption that the underlying data-generating process is known, or at least resembles the assumption. The first four structured estimators correspond to the models 'independent marginals', 'independent and identical marginals', 'observed multi-factor model' and 'constant correlation'. Coskewness estimation includes an additional model based on the latent 1-factor model proposed in Simaan (1993).
The constant correlation and 1-factor coskewness and cokurtosis matrices can be found in Martellini and Ziemann (2010). If f is a matrix containing multiple factors, then the multi-factor model of Boudt, Lu and Peeters (2915) is used. For information about the other structured matrices, we refer to Boudt, Cornilly and Verdonck (2017)
Boudt, Kris, Lu, Wanbo and Peeters, Benedict. 2015. Higher order comoments of multifactor models and asset allocation. Finance Research Letters, 13, 225-233.
Boudt, Kris, Brian G. Peterson, and Christophe Croux. 2008. Estimation and Decomposition of Downside Risk for Portfolios with Non-Normal Returns. Journal of Risk. Winter.
Boudt, Kris, Cornilly, Dries and Verdonck, Tim. 2017. A Coskewness Shrinkage Approach for Estimating the Skewness of Linear Combinations of Random Variables. Submitted. Available at SSRN: https://ssrn.com/abstract=2839781
Ledoit, Olivier and Wolf, Michael. 2003. Improved estimation of the covariance matrix of stock returns with an application to portfolio selection. Journal of empirical finance, 10(5), 603-621.
Martellini, Lionel and Ziemann, V\"olker. 2010. Improved estimates of higher-order comoments and implications for portfolio selection. Review of Financial Studies, 23(4), 1467-1502.
Simaan, Yusif. 1993. Portfolio selection and asset pricing: three-parameter framework. Management Science, 39(5), 68-577.
CoMoments
ShrinkageMoments
EWMAMoments
MCA
data(edhec) # structured estimation with constant correlation model # 'as.mat = F' would speed up calculations in higher dimensions sigma <- M2.struct(edhec, "CC") m3 <- M3.struct(edhec, "CC") m4 <- M4.struct(edhec, "CC") # compute equal-weighted portfolio modified ES mu <- colMeans(edhec) p <- length(mu) ES(p = 0.95, portfolio_method = "component", weights = rep(1 / p, p), mu = mu, sigma = sigma, m3 = m3, m4 = m4)#> $MES #> [1] 0.00739374 #> #> $contribution #> [1] -2.174737e-04 1.037324e-03 -1.412870e-04 2.366756e-03 -6.847000e-04 #> [6] -1.394153e-04 -4.406927e-04 -6.668250e-05 4.277083e-04 -4.898553e-04 #> [11] -4.792436e-04 6.212463e-03 8.838070e-06 #> #> $pct_contrib_MES #> [1] -0.029413215 0.140297582 -0.019109000 0.320102752 -0.092605373 #> [6] -0.018855859 -0.059603495 -0.009018778 0.057847360 -0.066252706 #> [11] -0.064817489 0.840232875 0.001195345 #># compare to sample method sigma <- cov(edhec) m3 <- M3.MM(edhec) m4 <- M4.MM(edhec) ES(p = 0.95, portfolio_method = "component", weights = rep(1 / p, p), mu = mu, sigma = sigma, m3 = m3, m4 = m4)#> $MES #> [1] 0.03241585 #> #> $contribution #> [1] 0.0074750513 -0.0028125166 0.0039422674 0.0069376579 0.0008077760 #> [6] 0.0037114666 0.0043125937 0.0007173036 0.0036152960 0.0013693293 #> [11] 0.0037650911 -0.0048178690 0.0033924063 #> #> $pct_contrib_MES #> [1] 0.23059863 -0.08676361 0.12161541 0.21402052 0.02491917 0.11449542 #> [7] 0.13303965 0.02212817 0.11152864 0.04224258 0.11614968 -0.14862694 #> [13] 0.10465269 #>