computational-finance

Estimation of rolling Value at Risk (VaR) using R

不想你离开。 提交于 2019-12-01 02:09:25
问题 I need to perform rolling VaR estimation of daily stock returns. At first I did the following: library(PerformanceAnalytics) data(edhec) sample<-edhec[,1:5] var605<-rollapply(as.zoo(sample),width=60,FUN=function(x) VaR(R=x,p=.95,method="modified",invert=T),by.column=TRUE,fill=NA) It performs the computation and returns a zoo object but gives a series of warnings as follows: VaR calculation produces unreliable result (inverse risk) for column: 1 : -0.00030977098532231 Then, I tried the same