Open aarchiba opened 2 years ago
Here's a notebook that demonstrates the problem - sorry it's a PDF, I can't upload notebooks directly. absphase.pdf
How this interacts with Fitter objects is not so clear - I think we treat TZRMJD differently from every other parameter, so the Fitter might or might not care whether the derivative there is zero.
The way PINT computes phase (relative or absolute) is complicated and confusing and poses real challenges for handling pulse numbers (see issues #1034, #589, #512 and PR #443 for examples).
Here's a notebook that demonstrates the problem - sorry it's a PDF, I can't upload notebooks directly.
Yeah, I've been working on a similar notebook. Note that there is also model.d_phase_d_param_num()
so you don't have to use numdifftools.
I trust numdifftools
to give accurate but slow answers. Also not to have the same assumptions baked into it as our analytic derivatives.
Is this still a problem?
TODO: Investigate further if this issue still persists. TODO: AD with JAX instead of numdifftools
Related #1303
model.d_phase_d_param()
returns a derivative whose mean is zero. This is wrong if one is working with absolute phases - if the model containsTZRMJD
, all derivatives should be exactly zero there. This arose in #1261, wheretest_derivative_equals_numerical
began failing when comparing returned phases to numerical derivatives.