R: [R] adding trend to an arima model

Vito Muggeo vito.muggeo at giustizia.it
Thu Mar 4 16:14:54 CET 2004


As arima.sim() simulates stationary ARMA "errors" if your underlying model
is additive I think you can type, for instance, just:

x<-1:100 #time variable
mu<-10+.5*x #linear trend
y<-arima.sim(length(x), model=list(ar=.5, ma=-.3),sd=25)+mu
arima(y, order=c(1,0,1),include.mean=TRUE,xreg=x)


best,
vito

----- Original Message -----
From: Samuel Kemp <sam.kemp2 at ntlworld.com>
To: <r-help at stat.math.ethz.ch>
Sent: Thursday, March 04, 2004 2:17 PM
Subject: [R] adding trend to an arima model


> Hi,
>
> Does anyone know a method for adding a linear/polynominal trend to a
> simulated arima model using the arima.sim function?
>
> Any help will be greatly appreciated.
>
> Cheers,
>
> Sam.
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html




More information about the R-help mailing list