Skip to content
Prev 15116 / 15274 Next

VaRTest in rugarch package version 1.4.9 returns NaN

Hi Ayla,

That?s been a problem with the implementation of the VaR test for some time with large data due
to underflow. I?ll look into fixing this in the next release, but in the meantime you can try the
new  package for time series tests which fixes this problem : https://github.com/tsmodels/tstests

Most of rugarch has already been re-written/ported to tsgarch and the tests in rugarch
to tstests.

Example:

####
library(tstests)

# load the data
filename = "bugreport_var_test_var.csv"
var = read.csv(file = filename)
filename = "bugreport_var_test_log_reg.csv"
data = read.csv(file = filename)

# try the test with full data
print(var_cp_test(data[,1], var[,1], 0.05))

Value at Risk Tests (Christoffersen and Pelletier)
Hypothesis(H0) : Unconditional(UC), Independent(CCI), Joint Coverage(CC) and Duration(D) 

            DoF  Chisq Pr(>Chisq)    
Kupiec (UC)   1  3.414  6.466e-02   .
CP (CCI)      1 15.113  1.013e-04 ***
CP (CC)       2 18.527  9.484e-05 ***
CP (D)        1 30.013  4.291e-08 ***

---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Coverage	: 0.05
Obs.		: 3419 
Failures	: 195 
E[Failures]	: 170 



Alexios