enh(SES): improve implementation - #973
Conversation
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
CodSpeed Performance ReportMerging #973 will not alter performanceComparing Summary
|
|
Thanks. Can you just elaborate on the following?
The fitted values are supposed to be the one-step ahead forecasts with an expanding training set, so the first value should be NaN. |
José Morales (jmoralez)
left a comment
There was a problem hiding this comment.
Thanks but I think the big win here is just using brent and we can avoid complicating things.
|
José Morales (@jmoralez) tests are failing, see my PR Nixtla/coreforecast#79 for fix to C++ code for EMA, which should fix the issue. 🤞 |
|
Christopher Titchen (@christophertitchen) can you restore your numba function? It'll take me a bit longer to do the coreforecast release because I want to refactor all the single array functions. Sorry for the troubles. |
No worries! |

Summary
README.mdto note support for in-sample fitted values forSimpleExponentialSmoothing,SimpleExponentialSmoothingOptimized,SeasonalExponentialSmoothing, andSeasonalExponentialSmoothingOptimized.Set the first in-sample fitted value in_ses_fcst_mseto the first observation, rather thannp.nan, to make it explicitly clear that the initial state is the first observation._ses_fcst_mseby, for example, pre-calculating the smoothing complement,_optimized_ses_forecastby changing fromscipy.optimize.minimizetoscipy.optimize.minimize_scalar. This uses Brent's method which is derivative-free and optimised for local one-dimensional optimisation problems like this, with guaranteed convergence within a reasonable number of evaluations. The convergence will also be superlinear for our strictly convexSimpleExponentialSmoothingOptimizedandSeasonalExponentialSmoothingOptimized, whereAdd a temporary benchmark totest_efficiency.pyfor CodSpeed.Benchmarks
Memory Profile
Base
Head