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: =============================================> 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
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
Hi, arima expects an order 4 model by specifying order=c(4,0,0). It looks like you want to fit an order 6 model with parameters 2 and 3 fixed to 0. Try order=c(6,0,0) and fixed=c(NA,0,0,NA,NA,NA,NA), the last NA is for the intercept. Henning 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: > > =============================================> >>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 > > ______________________________________________ > 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 >-- Henning Rust Potsdam Institute for Climate Impact Research Dept. Integrated Systems Analysis Tel.: #49/331/288-2596 Fax.: #49/331/288-2640 PGP : pgp.mit.edu Please avoid sending me Word or PowerPoint attachments, send plain text or PDF instead. See http://www.fsf.org/philosophy/no-word-attachments.html