fmSdDecomp | R Documentation |
Compute the factor contributions to standard deviation (SD) of assets' returns based on Euler's theorem, given the fitted factor model.
fmSdDecomp(object, ...)
## S3 method for class 'tsfm'
fmSdDecomp(object, factor.cov, use = "pairwise.complete.obs", ...)
## S3 method for class 'sfm'
fmSdDecomp(object, factor.cov, use = "pairwise.complete.obs", ...)
## S3 method for class 'ffm'
fmSdDecomp(object, factor.cov, ...)
object |
fit object of class |
... |
optional arguments passed to |
factor.cov |
optional user specified factor covariance matrix with named columns; defaults to the sample covariance matrix. |
use |
method for computing covariances in the presence of missing values; one of "everything", "all.obs", "complete.obs", "na.or.complete", or "pairwise.complete.obs". Default is "pairwise.complete.obs". |
The factor model for an asset's return at time t
has the
form
R(t) = beta'f(t) + e(t) = beta.star'f.star(t)
where, beta.star=(beta,sig.e)
and f.star(t)=[f(t)',z(t)]'
.
By Euler's theorem, the standard deviation of the asset's return
is given as:
Sd.fm = sum(cSd_k) = sum(beta.star_k*mSd_k)
where, summation is across the K
factors and the residual,
cSd
and mSd
are the component and marginal
contributions to SD
respectively. Computing Sd.fm
and
mSd
is very straight forward. The formulas are given below and
details are in the references. The covariance term is approximated by the
sample covariance.
Sd.fm = sqrt(beta.star''cov(F.star)beta.star)
mSd = cov(F.star)beta.star / Sd.fm
A list containing
Sd.fm |
length-N vector of factor model SDs of N-asset returns. |
mSd |
N x (K+1) matrix of marginal contributions to SD. |
cSd |
N x (K+1) matrix of component contributions to SD. |
pcSd |
N x (K+1) matrix of percentage component contributions to SD. |
Where, K
is the number of factors and N is the number of assets.
Eric Zivot, Yi-An Chen and Sangeetha Srinivasan
Hallerback (2003). Decomposing Portfolio Value-at-Risk: A General Analysis. The Journal of Risk, 5(2), 1-18.
Meucci, A. (2007). Risk contributions from generic user-defined factors. RISK-LONDON-RISK MAGAZINE LIMITED-, 20(6), 84.
Yamai, Y., & Yoshiba, T. (2002). Comparative analyses of expected shortfall and value-at-risk: their estimation error, decomposition, and optimization. Monetary and economic studies, 20(1), 87-121.
fitTsfm
, fitFfm
for the different factor model fitting functions.
fmCov
for factor model covariance.
fmVaRDecomp
for factor model VaR decomposition.
fmEsDecomp
for factor model ES decomposition.
# Time Series Factor Model
# load data
data(managers, package = 'PerformanceAnalytics')
colnames(managers)
# Make syntactically valid column names
colnames(managers) <- make.names( colnames(managers))
colnames(managers)
fit.macro <- fitTsfm(asset.names=colnames(managers[,(1:6)]),
factor.names=colnames(managers[,(7:9)]),
rf.name="US.3m.TR", data=managers)
decomp <- fmSdDecomp(fit.macro)
# get the percentage component contributions
decomp$pcSd
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.