I am using betategarch package and when I use predict function it gives me error subscript out of bounds. I have researched it and did not get any results so far because this error is very general and I am not sure what to do and how to solve it. I also used (any(is.na)
function to check if I had any NA's because that was one of the proposition to solve my problem, but I did not have any missing values.
LOTOS.daily.xts
[,1]
2005-06-10 -0.016807118
2005-06-13 0.006756782
2005-06-14 0.000000000
2005-06-15 0.000000000
2005-06-16 -0.016978337
2005-06-17 -0.003430535
2005-06-20 -0.003442344
2005-06-21 0.000000000
2005-06-22 0.027212564
2005-06-23 -0.006734032
2005-06-24 -0.006779687
2005-06-27 0.010152371
2005-06-28 0.000000000
2005-06-29 -0.003372684
2005-06-30 0.000000000
str(LOTOS.daily.xts)
An ‘xts’ object on 2005-06-10/2005-06-30 containing:
Data: num [1:15, 1] -0.01681 0.00676 0 0 -0.01698 ...
Indexed by objects of class: [POSIXct,POSIXt] TZ:
xts Attributes:
NULL
Fitting my data:
Lotos.comp1 <- tegarch(LOTOS.daily.xts)
lotos.comp1.stdev <- fitted(Lotos.comp1)
Predicting:
set.seed(123)
predict(Lotos.comp1, n.ahead=60)
predict(Lotos.comp1, n.ahead=5)
Error in predict.tegarch(Lotos.comp1, n.ahead = 5) :
subscript out of bounds
Thank you