[SciPy-Dev] Prediction framework for (time) series

josef.pktd at gmail.com josef.pktd at gmail.com
Sat Mar 14 10:47:17 EDT 2015


On Sat, Mar 14, 2015 at 10:24 AM, Thomas Spura <thomas.spura at gmail.com>
wrote:

> Dear list,
>
> I like to add a prediction framework to the interpolation module and
> submitted pull request #4632 [1]. After a first review by Ralf Gommers, I'm
> writing here to discuss the broader applicability of this method and the
> possible API.
>
> There are two additions for now:
> - The `Cache` class that keeps track of the last n values of the data,
> that can be added with a `.add` method and the new value in the series can
> be predicted with `.predict`. This class should be independant of the
> method to predict the new value in the series, so also other methods such
> as splines could be added in principle so it can be applied to various
> cases from molecular dynamics to stock marked prediction.
> - The `always_stable_projector` method takes a given series and tries to
> predict the next value in the row with the method of Kolafa [2]. One
> feature is that it is designed to be time reversible, which makes it
> favorable to use it in molecular dynamics. For other problems, splines
> might be better, so how about the following prediction framework:
>
> * Adding the current `predict.py` as `_predict.py` to the interpolate
> module.
> * Rename the class to `Predict` and a `method` keyword to the constructor,
> similar to what `scipy.optimize.minimize` does.
>
> Do you think this would be usefull to add to scipy?
>


some preliminary comments without access to the paper:

How does this differ from a convolution with the combinatorial (?) window?
The loop in always_stable_predictor doesn't seem to really have any
recursive structure and would be just (data * window).sum() if my reading
is correct.

time series (with regular or uniform time spacing) in scipy are in
scipy.signal, I'm not sure this fits in scipy.interpolate.

If Cache is a moving window class, or  recursive online updating class,
then there should be more explicit plans what to do with those. AFAIR,
there is nothing like that yet in scipy, but it has been discussed
sometimes.

(pandas has moving, rolling window functions, statsmodels has time series
prediction that is a bit similar but concentrated on ARIMA, VAR and
statespace style models)


Josef




>
> Greetings,
>     Thomas
>
> [1] https://github.com/scipy/scipy/pull/4632
> [2] http://dx.doi.org/10.1002/jcc.10385
>
> _______________________________________________
> SciPy-Dev mailing list
> SciPy-Dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20150314/1db3f045/attachment.html>


More information about the SciPy-Dev mailing list