[R] rugarch package: is this forecast correct?
R. Michael Weylandt
michael.weylandt at gmail.com
Tue Dec 6 13:17:48 CET 2011
The calculation is numerically stable on my machine: I'd mark it up as
computational/floating-point error and not worry about it.
Michael
On Mon, Dec 5, 2011 at 11:13 PM, Ivan Popivanov
<ivan.popivanov at gmail.com> wrote:
> Let me start with the code:
>
> library(quantmod)
> library(rugarch)
> getSymbols("SPY", from="1900-01-01")
> rets=na.trim(diff(log(Cl(SPY))))
> tt = tail(rets["/2004-10-29"], 1000)
> spec = ugarchspec(variance.model=list(garchOrder=c(1,1)),
> mean.model=list(armaOrder=c(2,5)), distribution.model="sged")
> for(ii in 1:10)
> {
> ttFit = ugarchfit( spec=spec, data=as.vector(tt), out.sample=0,
> solver.control=list(trace=F) )
> ttFore = ugarchforecast( ttFit, n.ahead=1, n.roll=0 )
> print( as.array(ttFore)[,2,] )
> }
>
> Produces two different results: -0.001087313 and -0.001092084, each
> repeated a few times.
>
> What is the explanation for that? Since they are based on previous data, I
> was expecting single step forecasts to produce the same result.
>
> Thanks in advance!
> Ivan
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help
mailing list