<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Mar 14, 2015 at 10:24 AM, Thomas Spura <span dir="ltr"><<a href="mailto:thomas.spura@gmail.com" target="_blank">thomas.spura@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Dear list,<div><br></div><div>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.</div><div><br></div><div>There are two additions for now:</div><div>- 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.</div><div>- 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:</div><div><br></div><div>* Adding the current `predict.py` as `_predict.py` to the interpolate module.</div><div>* Rename the class to `Predict` and a `method` keyword to the constructor, similar to what `scipy.optimize.minimize` does.</div><div><br></div><div>Do you think this would be usefull to add to scipy?</div></blockquote><div><br></div><div><br></div><div>some preliminary comments without access to the paper:</div><div><br></div><div>How does this differ from a convolution with the combinatorial (?) window? The loop in <span style="color:rgb(121,93,163);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.7999992370605px;white-space:pre;background-color:rgb(234,255,234)">always_stable_predictor</span> doesn't seem to really have any recursive structure and would be just (data * window).sum() if my reading is correct.</div><div><br></div><div>time series (with regular or uniform time spacing) in scipy are in scipy.signal, I'm not sure this fits in scipy.interpolate.</div><div><br></div><div>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.</div><div><br></div><div>(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)</div><div><br></div><div><br></div><div>Josef</div><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div><br></div><div>Greetings,</div><div> Thomas</div><div><br></div><div>[1] <a href="https://github.com/scipy/scipy/pull/4632" target="_blank">https://github.com/scipy/scipy/pull/4632</a></div><div>[2] <a href="http://dx.doi.org/10.1002/jcc.10385" target="_blank">http://dx.doi.org/10.1002/jcc.10385</a></div>
<br>_______________________________________________<br>
SciPy-Dev mailing list<br>
<a href="mailto:SciPy-Dev@scipy.org">SciPy-Dev@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/scipy-dev" target="_blank">http://mail.scipy.org/mailman/listinfo/scipy-dev</a><br>
<br></blockquote></div><br></div></div>