feat: Rename DM/chromatic Fourier bases, add FFT-cov DM/chrom GPs and priors#129
feat: Rename DM/chromatic Fourier bases, add FFT-cov DM/chrom GPs and priors#129danielreardon wants to merge 1 commit into
Conversation
Clarify chromatic GP naming and extend the FFT-covariance GP family. Naming: the old `dmfourierbasis` / `dmfourierbasis_alpha` names implied a DM process even when the chromatic index is a free parameter (in which case the process is not DM). Add clearly-named replacements: - `fourierbasis_dm` / `make_fourierbasis_dm` (fixed alpha = 2, genuine DM) - `fourierbasis_chrom` / `make_fourierbasis_chrom` (variable alpha, chromatic) The old `dmfourierbasis`, `dmfourierbasis_alpha`, `make_dmfourierbasis`, and `make_dmtimeinterpbasis` are kept as thin wrappers that emit a DeprecationWarning and delegate to the new functions, so existing code keeps working. New FFT-covariance GPs: `makegp_fftcov_dm` and `makegp_fftcov_chrom` (time-domain covariance, analogous to the existing achromatic `makegp_fftcov`), backed by new `make_timeinterpbasis_dm` / `make_timeinterpbasis_chromatic` bases. Their default GP names are `dm_gp` / `chrom_gp` so their parameters resolve against the standard priors. Priors: add default uniform priors for the DM/chromatic GP parameters (`dm_gp_*`, `chrom_gp_*`, `chromgp_*`) to `priordict_standard`. Measurement noise: extend `makenoise_measurement_simple` with `add_equad` and `tnequad` options (EFAC-only and TempoNest-EQUAD conventions). Also propagate the renames through `models/epta.py`, the README, and the docs, and add `tests/test_chromatic_signals.py` covering basis scaling, the deprecated aliases, the FFT-cov GPs, the new default priors, and the measurement-noise model. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
meyers-academic
left a comment
There was a problem hiding this comment.
This looks good. Let me know if the comment about the structure of the Fourier bases makes sense? It might just be a cleaner construction, but I don't know if it would have downstream effects. I do think the measurement noise stuff can move to the test_measurement_noise.py tests. But otherwise, I think this is basically ready.
| shape = solar.make_solardm(psr)(1.0) | ||
|
|
||
| return f, df, fmat * shape[:, None] | ||
| def make_fourierbasis_dm(alpha=2.0, tndm=False): |
There was a problem hiding this comment.
I'm not sure I even realized this code was in here, which is maybe silly of me. Would it make sense for us to have some construction here where alpha=None is the default, and then fourierbasis_dm = make_fourierbasis_dm(alpha=2.0) and if alpha is not None then we just return a static matrix? Then we don't need both fourierbasis_dm and this closure.
I think this would be cleaner overall (I was just looking at a very similar construction for a larger refactor for functions like powerlaw(), etc.)
There was a problem hiding this comment.
That makes sense. Though I have been constructing everything with makegp_fourier as below, so my current codes would need fourierbasis_dm. Having both maintains flexibility
signals.makegp_fourier(psr, signals.powerlaw, components=psr_components, fourierbasis=signals.fourierbasis_dm, name='dm_gp')
and
signals.makegp_fourier(psr, signals.powerlaw, components=psr_components, fourierbasis=signals.fourierbasis_chrom, name='chrom_gp'
| # --------------------------------------------------------------------------- | ||
|
|
||
| @pytest.mark.unit | ||
| def test_measurement_simple_default_params(psr): |
There was a problem hiding this comment.
I think there should be a test_measurement_noise.py that these can go in. I think it would make more sense for them to live there.
…#129 naming convention) Already the equivalent of upstream's make_solardmfourierbasis, so no new function needed - just align the name with the direct-basis convention (fourierbasis_dm / fourierbasis_chrom). Renamed outright (no alias) and updated the mpta.py reference and tests. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Renaming of chromatic GP functions and and extend the fftcov GPs to dm and chromatic function.
Naming: the old
dmfourierbasis/dmfourierbasis_alphanames implied a DM process even when the chromatic index is a free parameter (in which case the process is not DM). Add clearly-named replacements:fourierbasis_dm/make_fourierbasis_dm(fixed alpha = 2, genuine DM)fourierbasis_chrom/make_fourierbasis_chrom(variable alpha, chromatic) The olddmfourierbasis,dmfourierbasis_alpha,make_dmfourierbasis, andmake_dmtimeinterpbasisare kept as thin wrappers that emit a DeprecationWarning and delegate to the new functions, so existing code keeps working.New FFT-covariance GPs:
makegp_fftcov_dmandmakegp_fftcov_chrom(time-domain covariance, analogous to the existing achromaticmakegp_fftcov), backed by newmake_timeinterpbasis_dm/make_timeinterpbasis_chromaticbases. Their default GP names aredm_gp/chrom_gpso their parameters resolve against the standard priors.Priors: add default uniform priors for the DM/chromatic GP parameters (
dm_gp_*,chrom_gp_*,chromgp_*) topriordict_standard.Measurement noise: extend
makenoise_measurement_simplewithadd_equadandtnequadoptions (EFAC-only and TempoNest-EQUAD conventions).Also propagate the renames through
models/epta.py, the README, and the docs, and addtests/test_chromatic_signals.pycovering basis scaling, the deprecated aliases, the FFT-cov GPs, the new default priors, and the measurement-noise model.