.

We can start by calculating the daily returns of the portfolio:

returns = diff(log(dat)) # log returns

Then, we can use the quantile function to calculate the 1% value at risk:

VaR = -quantile(returns, 0.99) * 170 VaR

Output: [1] 14.7919

Therefore, the Value at Risk at the 99% level of confidence for this portfolio is $14.79.

采用R语言完成 dat = iris$SepalLengthSuppose you have a portfolio consisting only of this asset and that the curent portfolio value is $170Using Basic Historical simulation and methods covered inLectures 10

原文地址: https://www.cveoy.top/t/topic/Yof 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录