[R-SIG-Finance] ARIMA question

Jeff Ryan jeff.a.ryan at gmail.com
Wed Nov 7 20:47:01 CET 2007


The third comment should say subtract the residuals from the data,
though the code is correct.

Jeff

On Nov 7, 2007 1:39 PM, Jeff Ryan <jeff.a.ryan at gmail.com> wrote:
> I think it is as simple as backing out from the residuals:
>
> # an MA2 model
> x <- arima.sim(list(ma=2),n=100)
>
> #Fitted as such...
> x.model <- arima(x,c(0,0,2))
>
> # SUBTRACT the residuals FROM the original data
> x.insample.fit <- x-residuals(x.model)
>
> # and you can even see them:
> plot(x)
> par(new=TRUE)
> lines(x.insample.fit,col=3,lty=2)
>
> Jeff
>
>
> On Nov 7, 2007 12:47 PM, Yalla, Swaroop (FID)
>
> <Swaroop.Yalla at morganstanley.com> wrote:
> > Hi:
> >
> > I have another ARIMA question for R. I was finally able to use ARIMA
> > modeling on my data. Now to forecast out of sample, we can use
> > predict(fit, n.ahead = 10) type of command and thats fine- but how can I
> > see the fit in-sample. I mean is there a easy way to just compare the
> > actual data with the fitted model in-sample?
> >
> > thanks for all the help..
> > Swaroop
> > --------------------------------------------------------
> >
> > This is not an offer (or solicitation of an offer) to bu...{{dropped:24}}
> >
> > _______________________________________________
> > R-SIG-Finance at stat.math.ethz.ch mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> > -- Subscriber-posting only.
> > -- If you want to post, subscribe first.
> >
>



More information about the R-SIG-Finance mailing list