[Rd] stats/arima.c memory allocation

From: Matteo Bertini <matteo_at_naufraghi.net>
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:

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.

list of date sections of archive