Compare the 7 degree polynomial fit of omi Cet data (see attached). The fit is fine but the equation is clearly wrong. Also, the zero point being subtracted from each time parameter is near the mid-point of the date range.
Compare this to the 23 degree polynomial fit of Kepler RR Lyr data, which is correct. The zero point being subtracted from each time parameter is near the start of the date range. The other major difference is that it is quite a short range compared to the omi Cet data; a short filtered single-cycle section was filtered for analysis. What would this look like if the whole FITS file's range was used?
Diff:
Comment: High-order polynomials produce very, very large (t-t0)**n terms. To produce precision, the best strategy is to always make t0 the mid-time of the series.
Doug, would you recommend the mid-point element, i.e. t[size(t)/2] or the mean time value, i.e. sum(t)/size(t)?
Hi David, I would recommend the mean time value. All coefficients will be determined with maximum possible precision in that case, since the largest abs(t-tmean) will be smaller that the largest abs(t - t[size(t)/2]).
Thanks Doug. That's what I was wondering too and it makes sense. I suppose that for some particular distributions of times, these values could be equivalent, but not in the general case.
Hi David - I expect that you are well aware of how to nest polynomial calculations to maintain precision since you are a skilled programmer.
But if that doesn't sound familiar, let me know!
Hi Doug. If you're referring to Horner's method/scheme/rule, then yep. I can generate this form of the polynomial equation in the model dialog.
For various reasons, including the stability, and ability to determine derivatives and apply optimisation algorithms, the current TS based polyfit implementation will probably be replaced by the apache commons math implementation. This will also allow me to add extrema finding and goodness of fit functionality for EB and other analysis.
Implemented in https://sourceforge.net/p/vstar/code/1009
Horner's form will be added as a checkbox-selectable alternative in future. A key issue was ensuring sufficient precision in coefficients.