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 <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
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.
>
> ______________________________________________
> [EMAIL PROTECTED] 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

______________________________________________
[EMAIL PROTECTED] 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

Reply via email to