You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
DESIGN: Speed up innovations algorithm / filter with Cython or Numba? #5326
I'm not sure, but it seems as though this approach could be a lot faster for ARMA models since it avoids a lot of the unnecessary operations implicit in the matrix-based state space models approach. This is especially true for SARIMA models with long seasonal effects, which we have gotten several questions about.
I know @bashtage mentioned that his existing functions can be trivially sped up by numba, which I think we're planning to make an optional dependency?
I can also easily write a Cython version, but I don't know if we want to head more into the numba direction, since the code is easier for most people to read / edit / debug?
I suppose one has to do the experiment to see if it really is faster. It will probably have other warts when processes highly persistent or anti-persistent.
In general I think cython is more stable then numba, i.e. once the bugs are fixed, it's just C and we don't need to worry what the current version of JIT does.
numba is more useful for developers that don't know cython well enough, and maybe in cases where we need more flexibility.
I think with both of you, Chad and Kevin, using cython in tsa, there is no problem putting additional filters into cython.
When I get around to Poisson time series processes, then I'd rather use numba than cython because it looks less painful for me.
I guess so - where we are right now, we have a Cythonized version of the innovations algorithm that works only for specified ARMA processes, in e.g. innovations.arma_innovations. It can not be used with an estimated autocovariance function like stattools.innovations_algo can, because it takes advantage of the specific form of the autocovariance matrix for stationary ARMA processes.
I think you mentioned in your original PR for innovations_algo and innovations_filter that Numba yielded significant performance improvements, and that still seems to me like a worthwhile improvement, but could be a different issue / PR.
Activity
bashtage commentedon Oct 18, 2018
I suppose one has to do the experiment to see if it really is faster. It will probably have other warts when processes highly persistent or anti-persistent.
josef-pkt commentedon Oct 20, 2018
In general I think cython is more stable then numba, i.e. once the bugs are fixed, it's just C and we don't need to worry what the current version of JIT does.
numba is more useful for developers that don't know cython well enough, and maybe in cases where we need more flexibility.
I think with both of you, Chad and Kevin, using cython in tsa, there is no problem putting additional filters into cython.
When I get around to Poisson time series processes, then I'd rather use numba than cython because it looks less painful for me.
bashtage commentedon May 13, 2019
@ChadFulton Can this be closed now?
ChadFulton commentedon May 13, 2019
I guess so - where we are right now, we have a Cythonized version of the innovations algorithm that works only for specified ARMA processes, in e.g.
innovations.arma_innovations. It can not be used with an estimated autocovariance function likestattools.innovations_algocan, because it takes advantage of the specific form of the autocovariance matrix for stationary ARMA processes.I think you mentioned in your original PR for
innovations_algoandinnovations_filterthat Numba yielded significant performance improvements, and that still seems to me like a worthwhile improvement, but could be a different issue / PR.bashtage commentedon May 13, 2019
Sounds like this stays open.
jbrockmendel commentedon May 13, 2019
PERF tag?
ENH: Cythonize innovations_algo and innovations_filter
PERF: Cythonize innovations_filter and algo