[R] Bug in arima?
Prof Brian Ripley
ripley at stats.ox.ac.uk
Wed Apr 30 15:26:41 CEST 2003
Here's a reproducible example (R 1.7.0)
set.seed(1)
x <- rnorm(100)
arima(x, order=c(7, 1, 0), fixed = c(NA, NA, NA, 0, 0, 0, NA),
transform.pars = FALSE)
Coefficients:
ar1 ar2 ar3 ar4 ar5 ar6 ar7
-0.6838 -0.4126 -0.2236 0 0 0 0.0454
s.e. 0.0986 0.1115 0.0988 0 0 0 0.0843
and you did not set transform.pars.
Looks like the comment
fixed: optional numeric vector of the same length as the total
number of parameters. If supplied, only non-`NA' entries in
`fixed' will be varied. `transform.pars = TRUE' will be
overridden if any AR parameters are fixed.
has been copied from help(arima0) and is unimplemented in arima.
On Wed, 30 Apr 2003, Richard A. Bilonick wrote:
> I'm using the fixed argument in arima. Shouldn't ar4, ar5, and ar6
> display as zero in the output?
>
> Call:
> arima(x = window(log(hhprice), start = c(1990, 1), end = c(2003, 3)),
> order = c(7,
> 1, 0), xreg = window(ts.union(exa1 = lag(exa, -1), exa12 = lag(exa,
> -12), exb1 = lag(exb, -1), exc1 = lag(exc, -1), exc12 = lag(exc,
> -12)), start = c(1990, 1), end = c(2003, 3)), include.mean = FALSE,
> fixed = c(NA,
> NA, NA, 0, 0, 0, NA, NA, NA, NA, NA, NA))
>
> Coefficients:
> ar1 ar2 ar3 ar4 ar5 ar6 ar7
> exa1 exa12 exb1 exc1 exc12
> 0.0922 -0.1279 -0.2661 -0.0577 -0.0277 0.02 -0.2167
> -0.3015 0.3424 0.0281 0.0519 0.1715
> s.e. 0.0789 0.0801 0.0742 0.0000 0.0000 0.00 0.0853
> 0.0503 0.0515 0.0295 0.0257 0.0329
>
> Also, is the documentation wrong?
>
> From ?arima:
>
> fixed: optional numeric vector of the same length as the total
> number of parameters. If supplied, only non-`NA' entries in
> `fixed' will be varied. `transform.pars = TRUE' will be
> overridden if any AR parameters are fixed.
>
> The non-NA entries in my fixed argument are zeroes. Aren't these "fixed"
> to zero so they don't vary when a call is made to optim? I thought that
> was the purpose of the argument. I only wan ar1, ar2, ar3, and ar7 in
> the model so I'm setting ar4, ar5, and ar6 to zero.
>
> My main concern is that the predict.Arima function works correctly when
> using the fixed argument. I'm assuming, output display notwithstanding,
> that ar4-ar6 are actually fixed to zero when using fixed. When I try to
> manually make the forecast, the result is slightly different than what
> predict.Arima reports. I'm wondering if that is due to these
> coefficients not being set to zero?
>
> Rick B.
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
>
--
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