VaR.Marginal: Calculate the Marginal VaR of each element of a portfolio
Description
Marginal VaR is the difference between the VaR of the portfolio without the asset in question and the entire portfolio. This function calculates Marginal VaR for all instruments in the portfolio.
Usage
VaR.Marginal(R, p = 0.99, modified = TRUE, weightingvector=NULL)
Arguments
R
a vector, matrix, data frame, timeSeries or zoo object of asset returns or the components
p
confidence level for calculation, default p=.99
modified
TRUE/FALSE whether to use Cornish-Fisher VaR
weightingvector
vector of weights for each element in the portfolio
Value
matrix of Marginal VaRs
References
Denton M. and Jayaraman, J.D. Incremental, Marginal, and Component VaR. Sunguard. 2004.
data(edhec)
# construct a weighting vector for an equally weighted portfolio eqweight=t(rep(1/length(edhec), length(edhec)))
VaR.Marginal(R=edhec,p=0.99,weightingvector=eqweight)