Skip to content

rugarch package: VaR exceedances plot

1 message · T.Riedle

#
Dear all,



I am trying to backtest my VaR model in R using the rugarch package. Hence, I am trying to plot the VaR exceedances using following code from the rugarch package:



VaRplot(alpha=0.025,actual = returns,VaR = VaR,ylab = "daily log returns",xlab = "date")



Unfortunately, I get this error message and do not know the reason for this



Error in plot.window(...) : invalid 'ylim' value In addition: Warning message:

In as.double.xts(actual) : NAs introduced by coercion



If I take the ylim error message into account I get the error:



Error in VaRplot(alpha = 0.025, actual = returns, VaR = VaR, ylab = "daily log returns",  :

  unused argument (ylim = rangereturns)



I thought that it could be a mistake in my dataset. I converted the dataset into a xts object using following codes but this seems to be correct:


VaR<-xts(BuVaR_Chapter_13_4_VaR[,4],order.by=as.POSIXct(BuVaR_Chapter_13_4_VaR$Date))

returns<-xts(BuVaR_Chapter_13_4_VaR[,3],order.by=as.POSIXct(BuVaR_Chapter_13_4_VaR$Date))



Does anyone have an idea? Many thanks in advance.