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

Simulate correlated DM noise in wideband TOAs #1868

Merged
merged 13 commits into from
Jan 17, 2025

Conversation

abhisrkckl
Copy link
Contributor

Partially fixes #1660. Fitting a model to wideband TOAs in the presence of correlated DM noise is still not implemented.

@abhisrkckl abhisrkckl changed the title Simulate correlated DM noise in wideband TOAs WIP: Simulate correlated DM noise in wideband TOAs Dec 5, 2024
@abhisrkckl abhisrkckl changed the title WIP: Simulate correlated DM noise in wideband TOAs Simulate correlated DM noise in wideband TOAs Dec 6, 2024
@abhisrkckl abhisrkckl added the awaiting review This PR needs someone to review it so it can be merged label Jan 2, 2025
@@ -232,6 +235,7 @@ class ScaleDmError(NoiseComponent):
category = "scale_dm_error"

introduces_correlated_errors = False
introduces_dm_errors = True
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the purpose of this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently there is no way to distinguish between achromatic noise models and noise models that represent DM noise (such as PLDMNoise) that affects the DM part of the wideband likelihood. I added this attribute to distinguish such noise components. The timing model components that introduce a DM correction can already be distinguished by checking if they are derived from the Dispersion class.

assert t.is_wideband()

# There is correlated noise in DMs
assert (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this is some sort of a chi^2 test? Is there no better way to check for correlated noise?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. A better test will be something like Ljung-Box test. Unfortunately, it is not available in scipy. We will need to add statsmodels as a dependency to use that test.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like that test would not be very hard to implement, maybe include in PINT utils. Although it may not be needed just for this, it could be more broadly useful.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK... I have added the Ljung-Box test. For this I added statsmodels as a dependency for tests. It is not a dependency for the package itself since it is not used anywhere in the main code. #1776 may change that though.

@dlakaplan
Copy link
Contributor

Looks good. I wonder if this test should be used elsewhere for correlated noise checks. How useful is it to test for the presence of correlated noise in the data? Should we have a utility function for that? Not needed for this PR - just asking.

Should I merge?

@abhisrkckl
Copy link
Contributor Author

abhisrkckl commented Jan 17, 2025 via email

@abhisrkckl
Copy link
Contributor Author

abhisrkckl commented Jan 17, 2025 via email

@dlakaplan dlakaplan merged commit 5e4d4a3 into nanograv:master Jan 17, 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PLDMNoise doesn't work correctly with wideband TOAs
2 participants