fmVaRDecomp | R Documentation |
Compute the factor contributions to Value-at-Risk (VaR) of assets' returns based on Euler's theorem, given the fitted factor model. The partial derivative of VaR w.r.t. factor beta is computed as the expected factor return given fund return is equal to its VaR and approximated by a kernel estimator. Option to choose between non-parametric and Normal.
fmVaRDecomp(object, ...)
## S3 method for class 'tsfm'
fmVaRDecomp(
object,
factor.cov,
p = 0.05,
type = c("np", "normal"),
use = "pairwise.complete.obs",
...
)
## S3 method for class 'sfm'
fmVaRDecomp(
object,
factor.cov,
p = 0.05,
type = c("np", "normal"),
use = "pairwise.complete.obs",
...
)
## S3 method for class 'ffm'
fmVaRDecomp(
object,
factor.cov,
p = 0.05,
type = c("np", "normal"),
use = "pairwise.complete.obs",
...
)
object |
fit object of class |
... |
other optional arguments passed to |
factor.cov |
optional user specified factor covariance matrix with named columns; defaults to the sample covariance matrix. |
p |
tail probability for calculation. Default is 0.05. |
type |
one of "np" (non-parametric) or "normal" for calculating VaR. Default is "np". |
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 VaR of the asset's return is given by:
VaR.fm = sum(cVaR_k) = sum(beta.star_k*mVaR_k)
where, summation is across the K
factors and the residual,
cVaR
and mVaR
are the component and marginal
contributions to VaR
respectively. The marginal contribution to VaR
is defined as the expectation of F.star
, conditional on the loss
being equal to VaR.fm
. This is approximated as described in
Epperlein & Smillie (2006); a triangular smoothing kernel is used here.
Refer to Eric Zivot's slides (referenced) for formulas pertaining to the calculation of Normal VaR (adapted from a portfolio context to factor models)
A list containing
VaR.fm |
length-N vector of factor model VaRs of N-asset returns. |
n.exceed |
length-N vector of number of observations beyond VaR for each asset. |
idx.exceed |
list of numeric vector of index values of exceedances. |
mVaR |
N x (K+1) matrix of marginal contributions to VaR. |
cVaR |
N x (K+1) matrix of component contributions to VaR. |
pcVaR |
N x (K+1) matrix of percentage component contributions to VaR. |
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.
fmSdDecomp
for factor model SD 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:8)]),
data=managers)
VaR.decomp <- fmVaRDecomp(fit.macro)
# get the component contributions
VaR.decomp$cVaR
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.