[R] arima() in package ts.

Rolf Turner rolf at math.unb.ca
Mon Sep 23 21:59:22 CEST 2002


I've been trying to get comfy with arima() and associated functions
in the ts() package.  I'm thinking seriously about using this
package, and R generally, in a 4th year intro time series course that
I'm teaching this autumn.

I have a couple of questions about arima:

(1) The help file says that residuals component of the value returned
by arima() consists of the ``standardized'' residuals.  How
standardized?  I would have thought that standardized residuals would
equal

		(raw residuals) / sigma-hat

where sigma-hat is an estimate of the standard deviation of
the residuals.  But if I do

	flh <- arima(lh, order = c(3,0,0))
	var(flh$residuals)

I get 0.1824616, not (something close to) 1 as I would have expected.

And flh$sigma2 is 0.1786603 --- which is pretty close to the
foregoing value given by var().

Also I note that tsdiag.Arima creates

	rs <- object$resid
	stdres <- rs/sqrt(object$sigma2)

i.e. it undertakes ``standardization''.

So it looks to me as if the residuals component is NOT
``standardized''?  Am I correct?

(2) How is sigma2 calculated?  The help says that it is
the MLE of sigma-squared (the variance of the innovations).
Can it be computed directly from the residuals?  How?
(Since the whole MLE structure is very complicated, I'm
pretty sure the answer is ``No it can't'', but I'd like
a little more insight into what's going on here.)

(3) I tried

	x   <- rnorm(100)
	fx1 <- arima(x,c(1,0,0),c(1,0,0))
	fx2 <- arima(x,c(2,0,0))

Note that seasonality is not specified and so defaults to 1.

I would have thought that the coeficients of the second
model, say phi.21 and phi.22, would be related to the coefficients
of the first (``multiplicative'') model, say phi.1 and Phi.1,
by

	phi.21 = phi.1 + Phi.1
	phi.22 = -phi.1*Phi.1

(just multiplying out (1 - phi.1*x)(1 - Phi.1*x) and comparing
with 1 - phi.21*x - phi.22*x^2).

But I get

 > fx2$coef
        ar1         ar2   intercept 
 0.06465065  0.05896674 -0.10499616 
 > fx1$coef
        ar1        sar1   intercept 
 0.03339341  0.03339341 -0.10562032

so phi.1 + Phi.1 = 0.06678682 --- close but no cigar, and
-phi.1*Phi.1 = -0.001115120

What am I missing/misunderstanding?

Thanks for any insight.

				cheers,

					Rolf Turner
					rolf at math.unb.ca
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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 mailing list