[R-SIG-Finance] ARIMA question

Jeff Ryan jeff.a.ryan at gmail.com
Wed Nov 7 22:21:11 CET 2007


Actually there is one for the tseries class "arma" NOT "Arima" from stats.

> methods(fitted)
[1] fitted.arma*            fitted.default*         fitted.garch*
[4] fitted.isoreg*          fitted.nls*             fitted.quantmod*
[7] fitted.smooth.spline*   fitted.values.quantmod*

   Non-visible functions are asterisked

> search()
 [1] ".GlobalEnv"        "package:tseries"   "package:quadprog"
 [4] "package:quantmod"  "package:Defaults"  "package:zoo"
 [7] "package:stats"     "package:graphics"  "package:grDevices"
[10] "package:utils"     "package:datasets"  "package:methods"
[13] "Autoloads"         "package:base"
>

Jeff

On Nov 7, 2007 3:17 PM, Jeff Ryan <jeff.a.ryan at gmail.com> wrote:
> Do you have a particular version?  Mine does not have a method like that...
>
> > x.model
>
> Call:
> arima(x = x, order = c(0, 0, 2))
>
> Coefficients:
>          ma1      ma2  intercept
>       0.3812  -0.1138     0.0936
> s.e.  0.0956   0.0862     0.2631
>
> sigma^2 estimated as 4.318:  log likelihood = -215.15,  aic = 438.31
> > class(x.model)
> [1] "Arima"
> > methods(fitted)
> [1] fitted.default*         fitted.isoreg*          fitted.nls*
> [4] fitted.quantmod*        fitted.smooth.spline*   fitted.values.quantmod*
>
>    Non-visible functions are asterisked
> > fitted(x.model)
> NULL
>
> >
>
>
> On Nov 7, 2007 3:07 PM, Nathan Bryant <nbryant at optonline.net> wrote:
> >
> > There is a method called "fitted()" that applies to most model classes
> > including Arima, which does the same thing.
> >
> >
> > Jeff Ryan 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))
> > >
> > > # add the residuals to 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.
> > >>
> > >>
> > >
> > > _______________________________________________
> > > 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