-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert WaveX
to PLRedNoise
and DMWaveX
to PLDMNoise
#1694
Conversation
WaveX
/DMWaveX
componentsWaveX
to PLRedNoise
and DMWaveX
to PLDMNoise
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #1694 +/- ##
==========================================
+ Coverage 68.78% 68.96% +0.18%
==========================================
Files 105 105
Lines 24643 24696 +53
Branches 4409 4409
==========================================
+ Hits 16950 17031 +81
+ Misses 6588 6560 -28
Partials 1105 1105 ☔ View full report in Codecov by Sentry. |
WaveX
to PLRedNoise
and DMWaveX
to PLDMNoise
WaveX
to PLRedNoise
and DMWaveX
to PLDMNoise
This looks good, but it looks like the fit comparisons are only done in the example and not in the tests. Are additional tests possible? |
@dlakaplan I have added quantitative tests. |
src/pint/utils.py
Outdated
|
||
mlnlike = _get_wx2pl_lnlike(model, "WaveX", ignore_fyr=ignore_fyr) | ||
|
||
gamma_val, log10_A_val = minimize(mlnlike, [4, -13], method="Nelder-Mead").x |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are there any checks for whether or not this has actually converged?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added convergence checks
@dlakaplan Can you please merge this if it looks fine? |
WaveX
andPLRedNoise
are both Fourier representations of achromatic red noise. The difference is thatWaveX
is a deterministic model with free Fourier coefficients whereasPLRedNoise
is a GP model where the Fourier coefficients have been analytically marginalized. TheWaveX
coefficients can be converted toPLRedNoise
spectral parameters (amplitude and spectral index) by maximizing the following likelihood function:Here, a_j and b_j are the
WaveX
coefficients, epsilon represents their measurement uncertainties, and P(f) is a power law spectrum.This likelihood function has a different statistical interpretation than the analytically marginalized likelihood used for Bayesian analysis (it acts on timing residuals directly). Hence, its results are not expected to be fully consistent with the Bayesian results. Nevertheless, this conversion gives results fairly close to the Bayesian estimates (mostly within the 3-sigma level in the tests I have done).
The inverse
PLRedNoise
-->WaveX
conversion without using the TOAs is not possible sincePLRedNoise
has less information thanWaveX
.A similar relationship and conversion also apply to
DMWaveX
andPLDMNoise
.Please note that this does not work properly for wideband data due to bug #1660.
Also includes some sourcery refactors.