[R] Kalman Filtering?
Prof Brian Ripley
ripley at stats.ox.ac.uk
Wed Jun 15 18:34:57 CEST 2005
On Wed, 15 Jun 2005, Thomas Lumley wrote:
> On Wed, 15 Jun 2005, Spencer Graves wrote:
>
>> 1. The function "KalmanLike" seems to change its inputs AND
>> PREVIOUSLY MADE copies of the inputs.
>
> The strange thing is that it changes its inputs. It would be expected that
> this also changed previously made copies. The copies will just be
> references to the same actual object in memory (which is why changing the
> inputs is undesirable).
>
> Looking at the C code, it does change the a, P, and Pnew components of the
> model. I'm a little reluctant to mess with this code, but an R-level
> work-around should be to replace mod$P with mod$P+0 and so on in the
> call to .Call, as this will force copying.
It is quite intentional: it says so in the sources and there is a Warning
in the help file.
It was done to avoid making copies of very large matrices.
--
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