Estimation of rolling Value at Risk (VaR) using R

后端 未结 2 967
耶瑟儿~
耶瑟儿~ 2021-01-12 15:44

I need to perform rolling VaR estimation of daily stock returns. At first I did the following:

library(PerformanceAnalytics)
data(edhec)
sample<-edhec[,1:         


        
2条回答
  •  北荒
    北荒 (楼主)
    2021-01-12 16:11

    1) We can reproduce the warning using only VaR as follows:

    > VaR(R = edhec[seq(25, length=60), 5], p = .95, method = "modified", invert = TRUE)
    VaR calculation produces unreliable result (inverse risk) for column: 1 : -0.000203691774704274
        Equity Market Neutral
    VaR                    NA
    

    Try using a different method=.

    > VaR(R = edhec[seq(25, length=60), 5], p = .95, method = "gaussian", invert = TRUE)
        Equity Market Neutral
    VaR          -0.001499347
    

    2) With "gaussian" I still got warnings on the real data set but no errors. Try experimenting with the other "method" argument values that are available as well. See ?VaR .

    3) Note that by.column = TRUE can be omitted as it is the default.

提交回复
热议问题