Question: Programmation in R So I tried everything and i don't know what to do, and I still got this error : Error in ` [.default

Programmation in R

So I tried everything and i don't know what to do, and I still got this error : Error in `[.default`(n, 2, 2) : subscript out of bounds

I'm doing a GARCH modelling and I wanted to do the Value at Risk Exceedances Test, but nothing works so this is part of my code:

data_return <- data$APPL m <- ugarchspec(mean.model = list(armaOrder= c(1,0), include.mean = TRUE), variance.model = list(model = "fGARCH", garchOrder = c(1,1), submodel = "NAGARCH"), distribution.model = std) ## Rolling Window method to forecast sigma roll_m <- ugarchroll(spec = m, data_returns, n.start = 2768, refit.every = 50, n.ahead = 1, refit.window = "moving", solver = "hybrid", calculate.VaR = TRUE, VaR.alpha = c(0.01, 0.025, 0.05), keep.coef = TRUE) VaR_99 <- roll_m@forecast$VaR$`alpha(1%)` VaR_97 <- roll_m@forecast$VaR$`alpha(3%)` VaR_95 <- roll_m@forecast$VaR$`alpha(5%)` actual <- roll_m@forecast$VaR$realized ## Model performance at 1% risk level test_var <- VaRTest(alpha = 0.01, as.numeric(actual), as.numeric(VaR_99), conf.level = 0.99) > Error in `[.default`(n, 2, 2) : subscript out of bounds

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!