[R] Determine the order of Time series
Richard M. Heiberger
rmh at temple.edu
Tue Jul 15 17:49:57 CEST 2014
Yes, of course.
Please look at the tsdiagplot function in the HH package.
install.packages("HH") ## if you don't have it yet
?tsdiagplot
The example shows 0<p<3 and 0<q<3
You can change that to 6 and 10 with
X.loop <- arma.loop(X, order=c(6,0,10))
## The example dataset gives warnings and trapped errors because these
values are too big for this dataset.
X.dal <- diag.arma.loop(X.loop, x=X)
X.diag <- rearrange.diag.arma.loop(X.dal)
X.diagplot <- tsdiagplot(armas=X.loop, ts.diag=X.diag, lwd=1)
X.diagplot
## You will need a big plotting window to see this, the screen isn't big enough
pdf("example.pdf", width=24, height=12)
X.diagplot
dev.off()
This is my first example with two-digit q, and I discovered that the
ar:p,ma:q values are sequenced
alphabetically instead of numerically. That shows up as the
ar:0,ma:10 column appearing
between the ar:0,ma:1 and ar:0,ma:2 columns. I will fix it in the
next release of HH (probably late August).
Please let me (and the list) know how this works for you.
Rich
On Mon, Jul 14, 2014 at 3:49 PM, 张天添 <pennytianzh at hotmail.com> wrote:
>
>
>
> Dear R help team,
>
> I am currently stuck on how to determine the order of a data. I have plotted the ACF and PACF of the data and it does not seem to cuts off. Is that possible to plot AIC BIC of some order(p,q) say, 0<p<6 and 0<q<10 on the same graph so that I can compare the value of AIC and BIC to determine the best model to fit? (Please see attached picture that can clear describe what I am looking for.)
>
> Or, is there any other way to determine the order of the data?
>
> Thank you so much for your time
>
> Kind Regrads
>
> Penny
>
>
> ______________________________________________
> 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