From: Matteo Bertini <matteo_at_naufraghi.net>

Date: Sat, 09 Apr 2011 12:25:24 +0200

R-devel_at_r-project.org mailing list

https://stat.ethz.ch/mailman/listinfo/r-devel Received on Sat 09 Apr 2011 - 10:28:39 GMT

Date: Sat, 09 Apr 2011 12:25:24 +0200

Looking at the arima.c code related to arima fitting I noticed that the code
is mainly a merge of:

- Gardner, G, Harvey, A. C. and Phillips, G. D. A. (1980) Algorithm AS154. An algorithm for exact maximum likelihood estimation of autoregressive-moving average models by means of Kalman filtering. Applied Statistics 29, 311–322.
- Jones, R. H. (1980) Maximum likelihood fitting of ARMA models to time series with missing observations. Technometrics 20 389–395.

The first is used to fit the initial P0 matrix, and the second to do the forecasts.

The AS154 implementation of P0 computation is O(r^4/8) in memory requirements, where r is roughly the period length.

This is the origin of the ugly:

src/library/stats/src/arima.c:838: if(r > 350) error(_("maximum supported lag is 350"));

I noted on the same AS154 paper that the initial P0 verify this equation:

P0 = T P0 T' + R R'

So I modified the arima.c code to find iteratively the solution of this equation (starting from P0 = I)

The resulting code finds a solution very similar to the one of the original code in a fraction of the occupied memory and in a time that is similar for small lags and faster for bigger lags (without the r<350 limit).

Here the modified code: https://gist.github.com/911292

The question is, there are theoretical guarantees that the iterative solution is the right solution?

Some hints/directions/books?

Matteo Bertini

[[alternative HTML version deleted]]

R-devel_at_r-project.org mailing list

https://stat.ethz.ch/mailman/listinfo/r-devel Received on Sat 09 Apr 2011 - 10:28:39 GMT

Archive maintained by Robert King, hosted by
the discipline of
statistics at the
University of Newcastle,
Australia.

Archive generated by hypermail 2.2.0, at Sat 09 Apr 2011 - 20:10:43 GMT.

*
Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel.
Please read the posting
guide before posting to the list.
*