In our conversation about speedups, it seems like there are a few bottlenecks:
total number of curves to fit
cost of a single curve fitting routine
fourier model evaluation
A few ways to speed up the curve-fitting routine are noted here. In short, these are
adding an ftol param
adding an xtol param
specifying bounds on the curve-fitting
The first two establish the convergence criteria, and they're currently set at ~5e-8 — which is about 5 milliseconds, if our input time array is in days. Given that our errors are much larger than this (I'm pretty sure!), we might want to relax the convergence criteria — perhaps 1e-6.
The bounds-specifying might end up slowing down the process (because this resorts to a different algorithm) but it might be worth looking into!
In our conversation about speedups, it seems like there are a few bottlenecks:
A few ways to speed up the curve-fitting routine are noted here. In short, these are
The first two establish the convergence criteria, and they're currently set at ~5e-8 — which is about 5 milliseconds, if our input time array is in days. Given that our errors are much larger than this (I'm pretty sure!), we might want to relax the convergence criteria — perhaps 1e-6.
The bounds-specifying might end up slowing down the process (because this resorts to a different algorithm) but it might be worth looking into!