[R] Fixed parameters in an AR (or arima) model
Prof Brian Ripley
ripley at stats.ox.ac.uk
Wed Jan 14 16:12:23 CET 2004
On Wed, 14 Jan 2004, Jenný Brynjarsdóttir wrote:
> Hello
>
> I want to fit an AR model were two of the coefficients are fixed to zero
> (the second and third ar-coefficients).
>
> I used the "arima" function with the "fixed" argument but the ar3
> coefficient is not set to zero:
See the help page: you have forgotten about transform.pars. In the current
version of R (1.8.1) this works for me, with a warning, so I surmise your
version is not the current one (indeed looks like it is 1.7.0 or earlier).
> Y <- rnorm(23)
> arima(Y, order=c(4,0,0), xreg=1:23, fixed=c(NA,0,0,NA,NA,NA))
Call:
arima(x = Y, order = c(4, 0, 0), xreg = 1:23, fixed = c(NA, 0, 0, NA, NA,
NA))
Coefficients:
ar1 ar2 ar3 ar4 intercept 1:23
-0.4515 0 0 -0.0415 -0.3711 0.0236
s.e. 0.2414 0 0 0.2336 0.1991 0.0147
sigma^2 estimated as 0.4303: log likelihood = -23.05, aic = 56.11
Warning message:
some AR parameters were fixed: setting transform.pars = FALSE in: arima(Y,
order = c(4, 0, 0), xreg = 1:23, fixed = c(NA, 0, 0,
If you really have only 23 observations you are expecting a lot here!
>
> ==============================================
> > arima(Y, order=c(4,0,0), xreg=1:23, fixed=c(NA,0,0,NA,NA,NA))
>
> Call:
> arima(x = Y, order = c(4, 0, 0), xreg = 1:23, fixed = c(NA, 0, 0, NA, NA,
> NA))
>
> Coefficients:
> ar1 ar2 ar3 ar4 intercept 1:23
> 0.5370 0 0.4338 -0.8078 5.2991 -0.0421
> s.e. 0.0735 0 0.0000 0.1096 0.1081 0.0079
>
> sigma^2 estimated as 0.02665: log likelihood = 6.77, aic = -3.54
> ===============================================
>
> Why?
>
> Thanks,
> Jenný Brynjarsdóttir
--
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