[R] AR models
Prof Brian D Ripley
ripley at stats.ox.ac.uk
Sat Sep 4 09:23:45 CEST 1999
On Sat, 4 Sep 1999, Michael HART wrote:
> Thanks for all who have helped me with my original queries, below.
> I have now managed to import some data and use the ar modeling. Now I have
> some more specific questions about this package if anyone knows the answers
> to I would appreciate some help in clearing up a few issues.
> I used the routine ar.yw (amongst others) in the library ts. This routine
> automagically chose the ar model order for me. I was wondering what method
> it uses to do this?
You could try reading the help page:
aic: Logical flag. If `TRUE' then the Akaike Informa-
tion Criterion is used to choose the order of the
autoregressive model. If `FALSE', the model of
order `order.max' is fitted.
Order selection is done by AIC if `aic' is true. This
And AIC is described in the first, second and fourth reference, at least.
> The package allows the user to enter a maximum model order from which it
> chooses the model order it prefers (below this value). However I would like
> to force it to use a particular ar model order of my choice as I know how
> many theoretical processes are in the data (which is more that the order
> being chosen).
ar(x, aic=F, order=3), for example.
> Can someone with experience with this package or with ar modelling tell me
> how to make it force a particular model order.
Advice: do read the help pages on the functions you use, especially before
Library ts is close to but not the same as the functions in S-PLUS. These
and the backround are described in Venables & Ripley (1999) `Modern Applied
Statistics with S-PLUS' and how to do its examples in R is in the R version
of the script in the VR61* package on CRAN.
> Also the libraries ts and tseries each use the same name for their base data
> types but they are incompatible with each other.
We know they overlap, but I was not aware of incompatibility of the base
type (ts) which is defined in base R, not in any package. Package tseries
will be updated shortly: its author contributed some of the functionality
in package ts.
Brian D. Ripley, ripley at stats.ox.ac.uk
Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel: +44 1865 272861 (self)
1 South Parks Road, +44 1865 272860 (secr)
Oxford OX1 3TG, UK Fax: +44 1865 272595
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
More information about the R-help