assetDecomp | R Documentation |
Compute the asset contributions to Sd, VaR and ES of returns based on Euler's theorem
assetDecomp(object, weights = NULL, rm, p, type = c("np", "normal"), ...)
object |
fit object of class |
weights |
vector of weights of the assets in the portfolio. Default is NULL, in which case an equal weights will be used. |
rm |
one of "Sd" (Standard Deviation) or "VaR" (Value at Risk) or "ES" (Expected Shortfall) |
p |
tail probability for calculation. Default is 0.05. |
type |
one of "np" (non-parametric) or "normal". Default is "np". |
... |
other optional arguments |
Risk Decomposition report for every asset in the portfolio
Avinash Acharya
Epperlein and Smillie (2006) "Cracking VAR with Kernels" Risk.net
riskDecomp
for the Risk Decomposition function based on factors in the fitted model.
# Fundamental Factor Model
data("factorDataSetDjia5Yrs")
data("wtsDjiaGmvLo")
# fit a fundamental factor model
exposure.vars <- c("P2B", "MKTCAP")
fit <- fitFfm(data=factorDataSetDjia5Yrs, asset.var="TICKER", ret.var="RETURN",
date.var="DATE", exposure.vars=exposure.vars, z.score = "crossSection")
#non-parametric
weights = wtsDjiaGmvLo
sd.decomp = assetDecomp(fit, weights, rm = "Sd")
VaR.decomp = assetDecomp(fit, weights, rm = "VaR", p = 0.05)
ES.decomp = assetDecomp(fit, weights, rm = "ES", p = 0.05)
#normal dist
VaR.decomp = assetDecomp(fit, weights, rm = "VaR", p = 0.05, type = "normal")
ES.decomp = assetDecomp(fit, weights, rm = "ES", p = 0.05, type = "normal")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.