[R] arima.sim: innov querry
Rolf Turner
rolf.turner at xtra.co.nz
Tue Nov 22 02:41:17 CET 2011
On 22/11/11 13:04, Andy Bunn wrote:
> Apologies for thickness - I'm sure that this operates as documented and with good reason. However...
>
> My understanding of arima.sim() is obviously imperfect. In the example below I assume that x1 and x2 are similar white noise processes with a mean of 5 and a standard deviation of 1. I thought x3 should be an AR1 process but still have a mean of 5 and a sd of 1. Why does x3 have a mean of ~7? Obviously I'm missing something fundamental about the burn in or the innovations.
>
> x1<- rnorm(1e3,mean=5,sd=1)
> summary(x1)
> x2<- arima.sim(list(order=c(0,0,0)),n=1e3,mean=5,sd=1)
> summary(x2)
> x3<- arima.sim(list(order=c(1,0,0),ar=0.3),n=1e3,mean=5,sd=1)
> summary(x3) # why does x3 have a mean of ~7?
X_t = 0.3 * X_{t-1} + E_t
where E_t ~ N(5,1).
So E(X_t) = 0.3*E(X_{t-1}) + E(E_t), i.e
mu = 0.3*mu + 5, whence
mu = 5/0.7 = 7.1429 approx. = 7
So all is in harmony. OMMMMMMMMMMMMMMMMMM! :-)
cheers,
Rolf Turner
P. S. If you want the population mean of x3 to be 5, add 5 *after*
generating
x3 from innovations with mean 0.
R. T.
More information about the R-help
mailing list