Skip to content
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

More correct low-rank expansion of powerlaw noise #1877

Merged
merged 17 commits into from
Mar 27, 2025

Conversation

vhaasteren
Copy link
Member

@vhaasteren vhaasteren commented Jan 8, 2025

Has a dependency on #1896

The existing low-rank expansions for red noise and related processes are based on the Lentati et al. (2014) expansion which uses a diagonal prior for frequency modes at 1/T. This is only approximately correct when fitting for quadratic spindown. For DM variations, which use the same model, contemporary analyses now consequently also include a DM2 term to "make the analysis work". DM2 is not necessarily physical when doing a fully unconstrained fit, so it is more correct to let this term be modeled by the stochastic process.

A low-rank expansion with frequencies below 1/T can improve the expansion while keeping the prior matrix diagonal. This is explored in van Haasteren & Vallisneri (2014): https://doi.org/10.1093/mnras/stu2157

This PR implements that model. Note that newer and more accurate expansions are in development that have a nondiagonal prior matrix. The design idea is that the models in this PR will also be implemented as part of the Classes in this PR: they represent the same model, namely a correct powerlaw. The Lentati expansion is a physically different model with spectral leakage explicitly not present, so that is different.

We have coordinated with the tempo2 devs, and the additional parameters are:

  • TNDMFLOG, TNDMFLOG_FACTOR
  • TNCHROMFLOG, TNCHROMFLOG_FACTOR
  • TNREDFLOG, TNREDFLOG_FACTOR

The FLOG parameters dictate how many log-frequency-spaced extra bins we need below 1/T. The _FACTOR parameters dictate by what fraction the frequency needs to shrink every frequency bin. So setting both to 2 will lead to two new frequency bins: 1/(2T) and 1/(4T)

@vhaasteren vhaasteren self-assigned this Jan 8, 2025
@vhaasteren
Copy link
Member Author

I will merge in changes from #1762 , as those changes overlap with this one. I will get rid of the low-frequency cut-off, and instead use the corner frequency as in #1762 by @abhisrkckl

@vhaasteren vhaasteren marked this pull request as ready for review March 25, 2025 10:52
@vhaasteren vhaasteren added the awaiting review This PR needs someone to review it so it can be merged label Mar 25, 2025
@vhaasteren vhaasteren changed the title WIP: More correct low-rank expansion of powerlaw noise More correct low-rank expansion of powerlaw noise Mar 25, 2025
@abhisrkckl
Copy link
Contributor

Hi... can you please merge #1896 again? I just figured out that my fix was not general enough. I have updated the PR to address this.

@vhaasteren
Copy link
Member Author

Hi... can you please merge #1896 again? I just figured out that my fix was not general enough. I have updated the PR to address this.

I thought I had already just a few minutes ago. I did get an updated Changelog though, so it should be current now

@abhisrkckl
Copy link
Contributor

Please add a test that simulates TOAs using the newly added parameters.

@vhaasteren
Copy link
Member Author

vhaasteren commented Mar 26, 2025

@abhisrkckl , in test_pldmnoise.py and test_plchromnoise.py those parameters are added and used already. Even the PLRedNoise parameters are added there as a check. Previously that was also the only check that was done with the red noise model.

EDIT: There is one test I can think of that makes sense. To compare the covariance matrix you get from the red noise process. In principle we can compare it to an analytical powerlaw. However, the low-frequency cut-off is hard to assign to log-spaced frequency bins. My recommendation is to not do this test for powerlaw signals. For other types of kernels it's more doable. Here, I think the above tests are good enough

@vhaasteren
Copy link
Member Author

Hold off on this until we verify with Mike

@vhaasteren
Copy link
Member Author

Mike and I agreed to do this the same in PINT and Tempo2. The tempo2 PR is here: https://bitbucket.org/psrsoft/tempo2/pull-requests/93

So they are consistent. I think it's good to go like this @abhisrkckl

@abhisrkckl abhisrkckl merged commit 6a70a07 into nanograv:master Mar 27, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting review This PR needs someone to review it so it can be merged enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants