Hi everyone,
I'm struggling with adding external regressors X to arma+garch model using
the following script:
spec1121ex = ugarchspec(variance.model = list(model = "sGARCH", garchOrder
= c(2,1)),
mean.model = list(armaOrder = c(1,1), include.mean =
TRUE, external.regressors = X),
distribution.model = "std")
fit1121ex<-ugarchfit(data=rt[,1], spec=spec1121ex)
The regressor matrix X (currently) has the following form:
head(X) [,1] [,2] [,3] [,4] [,5]
[1,] 0 0 0 0 1
[2,] 1 0 0 0 0
[3,] 0 1 0 0 0
[4,] 0 0 1 0 0
[5,] 0 0 0 1 0
[6,] 0 0 0 0 1
When I run ugarchfit, I get an error:
Error in optim(init[mask], armaCSS, method = optim.method, hessian = TRUE, :
non-finite value supplied by optim
I make X from the table rtn
> head(rtn) SPY Mon Tue Wed Thu Fri
2009-01-05 -0.001189061 1 0 0 0 0
2009-01-06 0.006640603 0 1 0 0 0
2009-01-07 -0.030479920 0 0 1 0 0
2009-01-08 0.004134247 0 0 0 1 0
2009-01-09 -0.021711980 0 0 0 0 1
2009-01-12 -0.024224590 1 0 0 0 0
> X<-matrix(cbind(rtn[,2], rtn[,3], rtn[,4], rtn[,5], rtn[,6]), ncol=5)
Surprisingly sript runs fine if I choose ncol<5, e.g.
>X<-matrix(cbind(rtn[,3], rtn[,4], rtn[,5], rtn[,6]), ncol=4)
or
>X<-matrix(cbind(rtn[,2], rtn[,3], rtn[,4], rtn[,5]), ncol=4)
Thanks a lot,
--
Alec
[[alternative HTML version deleted]]
_______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only. If you want to post, subscribe first.
-- Also note that this is not the r-help list where general R questions should
go.