assetDecomp: Decompose portfolio risk into individual asset contributions...

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/assetDecomp.R

Description

Compute the asset contributions to Sd, VaR and ES of returns based on Euler's theorem

Usage

1
assetDecomp(object, weights = NULL, rm, p, type = c("np", "normal"))

Arguments

object

fit object of class tsfm, or ffm.

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

Value

Risk Decomposition report for every asset in the portfolio

Author(s)

Avinash Acharya

References

Epperlein and Smillie (2006) "Cracking VAR with Kernels" Risk.net

See Also

riskDecomp for the Risk Decomposition function based on factors in the fitted model.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
# 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") 

sangeeuw/factorAnalytics documentation built on May 28, 2019, 3:40 p.m.