Skip to content

Correctly incorporate correlated noise in WidebandDownhillFitter + Plot whitened DM residuals in pintk#1968

Open
abhisrkckl wants to merge 14 commits intonanograv:masterfrom
abhisrkckl:wbfit
Open

Correctly incorporate correlated noise in WidebandDownhillFitter + Plot whitened DM residuals in pintk#1968
abhisrkckl wants to merge 14 commits intonanograv:masterfrom
abhisrkckl:wbfit

Conversation

@abhisrkckl
Copy link
Copy Markdown
Contributor

@abhisrkckl abhisrkckl commented Feb 25, 2026

This PR implements the correct handling of DMGP in WidebandDownhillFitter based on https://arxiv.org/abs/2505.05274

The major changes are as follows.

  1. WidebandDownhillFitter now uses the wideband design matrix computed by TimingModel.wideband_designmatrix instead of constructing it inside the fitter.
  2. WidebandDownhillFitter now uses the wideband Ndiag computed by TimingModel.scaled_wideband_uncertainty instead of constructing it inside the fitter.
  3. WidebandDownhillFitter now computes the wideband residuals using WidebandTOAResiduals.calc_wideband_resids instead of doing it inside the fitter.
  4. GLS fitting now incorporates DMGP correctly. Earlier, only DMX was supported.
  5. WidebandDownhillFitter and WidebandState now have a structure more like other downhill fitter and state classes.

The GLS fitting expression is
image
where y, N, and M are the wideband residuals (2ntoa), wideband Ndiag (2ntoa x 2ntoa), and the wideband design matrix (2ntoa x nparam). Phi is the same as in narrowband timing (it contains the prior variances).

Also implements a new option to plot whitened DM residuals in pintk.

@abhisrkckl abhisrkckl changed the title WIP: Correctly incorporate correlated noise in WidebandDownhillFitter WIP: Correctly incorporate correlated noise in WidebandDownhillFitter + Plot whitened DM residuals in pintk Feb 25, 2026
@abhisrkckl abhisrkckl changed the title WIP: Correctly incorporate correlated noise in WidebandDownhillFitter + Plot whitened DM residuals in pintk Correctly incorporate correlated noise in WidebandDownhillFitter + Plot whitened DM residuals in pintk Mar 17, 2026
@abhisrkckl
Copy link
Copy Markdown
Contributor Author

abhisrkckl commented Mar 17, 2026

Whitened DM resids plot in pintk:
image

@abhisrkckl abhisrkckl requested a review from dlakaplan March 17, 2026 08:39
@dlakaplan
Copy link
Copy Markdown
Contributor

Hi, @abhisrkckl . I don't know the correlated-noise code well enough to really review this. Maybe @rossjjennings or @demorest or somebody else can look more closely?

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 23, 2026

Codecov Report

❌ Patch coverage is 88.88889% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.60%. Comparing base (1324586) to head (0ae6cf2).

Files with missing lines Patch % Lines
src/pint/pintk/plk.py 0.00% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1968      +/-   ##
==========================================
+ Coverage   70.57%   70.60%   +0.03%     
==========================================
  Files         110      110              
  Lines       25775    25730      -45     
  Branches     4060     4059       -1     
==========================================
- Hits        18190    18167      -23     
+ Misses       6443     6415      -28     
- Partials     1142     1148       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants