[R] adding trend to an arima model
Prof Brian Ripley
ripley at stats.ox.ac.uk
Thu Mar 4 15:45:23 CET 2004
What does "+" give you? It works for me -- simulate the model, simulate
the trend and add them.
x <- arima.sim(list(ar=0.3), 100) + 1:100
is an AR(1) with a linear trend.
> arima(x, c(1,0,0), xreg=1:100)
Call:
arima(x = x, order = c(1, 0, 0), xreg = 1:100)
Coefficients:
ar1 intercept 1:100
0.4510 -0.1704 1.0031
s.e. 0.0915 0.3528 0.0060
...
On Thu, 4 Mar 2004, Samuel Kemp wrote:
> Does anyone know a method for adding a linear/polynominal trend to a
> simulated arima model using the arima.sim function?
--
Brian D. Ripley, ripley at stats.ox.ac.uk
Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel: +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UK Fax: +44 1865 272595
More information about the R-help
mailing list