Re: [R] n step ahead forecasts

From: Weiwei Shi <helprhelp_at_gmail.com>
Date: Wed 24 Jan 2007 - 21:59:12 GMT

Dear Spencer:

just my2cent:
could you change the step from 1 to m, like 5 if you have a very large validation set. I have a feeling that it won't change too much about the result but I am not sure what your endpoint is.

weiwei

On 1/24/07, sj <ssj1364@gmail.com> wrote:
> hello,
>
> I have a question about making n step ahead forecasts in cases where test
> and validation sets are availiable. For instance, I would like to make one
> step ahead forecasts on the WWWusage data so I hold out the last 10
> observations as the validation set and fit an ARIMA model on the first 90
> observations. I then use a for loop to sequentially add 9 of the holdout
> observations to make 1 step ahead forecasts for the last 10 periods (see
> example code). In cases where there are relatively few periods I want to
> forecast for this seems to work fine, however I am working with a rather
> large validation set and I need to make n step ahead forecasts for many
> periods and it takes a very long time. Is there a more efficient way to do
> this?
>
>
>
> vset <- WWWusage[91:100]
>
> pred <-c()
> for (i in 0:9)
> { fit <-arima(WWWusage[1:(90+i)],c(3,1,0))
> p<- predict(fit,se.fit=F)
> pred <- c(pred, p)
> }
> plot(pred,type="o",col=2)
> lines(vset,type="o",col=1)
>
>
> thanks,
>
> Spencer
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help@stat.math.ethz.ch 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.
>

-- 
Weiwei Shi, Ph.D
Research Scientist
GeneGO, Inc.

"Did you always know?"
"No, I did not. But I believed..."
---Matrix III

______________________________________________
R-help@stat.math.ethz.ch 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.
Received on Thu Jan 25 14:26:49 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 25 Jan 2007 - 04:30:33 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.