
Jeff Garland wrote:
Eric Niebler wrote: <snip>
Any suggestions for improvements are most welcome.
Hi Eric -
Looks very interesting. Feedback here is based on extremely cursory look at the docs. And I'll say that I'm not a huge domain expert on the mathematics, but I've run into some pretty simple time series in couple of apps over the years.
In particular, I'm sorta surprised there isn't a moving average algorithm as that's time series algorithm with a really wide applicability. Classic example -- calculate a 10 day rolling average of the closing price of some stock. Or calculate a 20 minute rolling average of the trading prices or quotes. And, so on...there are all sorts of other applications for rolling averages.
Yep, that'd be a nice one to have. As I say in the description, the library is light on algorithms at the moment; the key is the infrastructure that makes the algorithms possible.
So now for the *other* question. Am I correct in seeing that with the time series facade that I might be able to plug in a different offset_type?
Yes. Of
course, what I'm thinking is for the stock price rolling average example above you might want to use gregorian::date or posix_time::ptime to represent point of measurement of the stock price. I wasn't finding the requirements for the offset_type...which is what I think would need to be replaced.
Right, I should document the requirements on the offset_type. The code has been tested with offset_types of int and double. I think the right concept for offset_type is LessThanComparible.
I also find the Discretization intervals interesting. Is that a standard way of handling the breakdown for statistical purposes? The thing being that only days and weeks are actually fixed lengths in the *messy world*...months, quarters, etc are all different depending leap years and such.
The Discretization template parameter is mostly there just for type checking your operations. You don't want to be adding a daily series with a yearly one, because that doesn't make sense. The fact that some years are leap years doesn't matter for the purpose of type checking.
Anyway, nice job as usual :-)
Thanks! :-) -- Eric Niebler Boost Consulting www.boost-consulting.com