[R-SIG-Finance] [R-sig-finance] VaR again

resident76 ctchadwick at hotmail.com
Wed Apr 29 17:51:05 CEST 2009

I have some code that handles the risk dissection for N assets, but it's
incorporated into some larger code so it might be confusing to just hand it
to you without trying to adapt it in a better form.  I would be glad to help
out and post it up for the other folks out there as well once I clean up the
confusion in it.  

The code doesn't address the V at R side, only the contribution of an asset's
volatility to the total volatility.  I'll take a look at your example and
try to formulate the code if that is something you might be interested in.


megh wrote:
> Hi all Gurus, I have a problem to quantify the riskiness of a typical
> position wherein this position is in some foreign country. Let me be more
> specific on my problem.
> Say I am a British investor and taken a position in NYSE, say in ATT
> (AT&T). Therefore apart from the risk due to fluctuation in stock quote of
> that, I am exposed of additional risk due to fluctuation in USD/GBP
> exchange rate. I intend to calculate the VaR of this position in GBP. Here
> I used monte carlo simulation approach to find that, which is as follows,
> please see the R code :
> # calculation of risk on an unit position
> att <- 25.67                                                                     
> # last traded price of AT&T in USD
> usdgbp <- 0.68366                                                            
> # last quote for USDGBP   
> vcv <- matrix(c(5.33727E-05, 2.56709E-05, 2.56709E-05,0.000176556), 2)         
> # VCV matrix for AT&T and USDGBP
> # We simulate 1-day ahead stock price and ex. rate assumig a Bi-variate
> normal dist. with above VCV structure
> library(mnormt)
> simu <- exp(rmnorm(10000, c(log(25.67),log(0.68366)), vcv))
> simu.pos.val <- apply(simu, 1, function(X) X[1]*X[2])                 #
> Simulated value of my position in USD
> abs(quantile(simu.pos.val, 0.05) - att*usdgbp)               # VaR (in
> GBP) in terms of Maximum possible loss
> Upto this point I am OK. However next thing automatically comes is that
> what is contribution of Stock and Ex. rate in total risk, i.e. Dissecting
> the risk. Can anyone please guide me how to do this for n-asset portfolio
> (of this kind) under MCS framework?
> Thanks

View this message in context: http://www.nabble.com/VaR-again-tp23293725p23296123.html
Sent from the Rmetrics mailing list archive at Nabble.com.

More information about the R-SIG-Finance mailing list