Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions