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

Fix MCMC_walkthrough.ipynb #1679

Merged
merged 24 commits into from Dec 7, 2023
Merged

Fix MCMC_walkthrough.ipynb #1679

merged 24 commits into from Dec 7, 2023

Conversation

dlakaplan
Copy link
Contributor

This notebook runs, although I'm not sure if the results are sensible/as intended.

@dlakaplan dlakaplan linked an issue Nov 16, 2023 that may be closed by this pull request
@dlakaplan
Copy link
Contributor Author

@dlakaplan
Copy link
Contributor Author

Strangely, when I run it locally I don't get the same errors and I don't get a good phase-o-gram

Copy link

codecov bot commented Nov 16, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (4d07835) 68.42% compared to head (5d5641b) 68.42%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1679   +/-   ##
=======================================
  Coverage   68.42%   68.42%           
=======================================
  Files         104      104           
  Lines       24339    24339           
  Branches     4346     4346           
=======================================
  Hits        16653    16653           
  Misses       6599     6599           
  Partials     1087     1087           

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

@dlakaplan
Copy link
Contributor Author

I thought I fixed the second error that appears by the phaseogram, but it's still there in the RTD.

@dlakaplan
Copy link
Contributor Author

So I fixed the syntax errors and now don't get good phase-o-grams. But at least now I see consistent results.

@dlakaplan
Copy link
Contributor Author

So I realized that the reason the phaseograms looked bad was because it was replacing F1 with the phase in the fit. It computed:

maxbin, like_start = marginalize_over_phase(
    phases, template, weights=fitter.weights, minimize=True, showplot=True
)
phase = 1.0 - maxbin[0] / float(len(template))

but then set fitvals[-1] equal to that value. So the initial fit position was horrible. As far as I can tell the fit only includes F0 and F1, and I don't understand where the phase comes into it. Maybe @scottransom knows?

@dlakaplan
Copy link
Contributor Author

Also, the second example discussed using a phase term in the likelihood (and hard a hard bound on the prior for that). But I don't see it in the model. With the phase prior removed it now doesn't give -inf for the likelihood.

@dlakaplan dlakaplan changed the title WIP: fix MCMC_walkthrough.ipynb Fix MCMC_walkthrough.ipynb Nov 17, 2023
@scottransom
Copy link
Member

The absolute phase information for the fit used to be tacked on invisibly at the end of the parameter vectors (that's why we loop up to :-1 for regular params). But now absolute phase is handled in PINT. So maybe that needs to be changed now.

@dlakaplan
Copy link
Contributor Author

The absolute phase information for the fit used to be tacked on invisibly at the end of the parameter vectors (that's why we loop up to :-1 for regular params). But now absolute phase is handled in PINT. So maybe that needs to be changed now.

Do you think that needs to be changed for this notebook? Or maybe we can merge this notebook back in and put in a new issue on adding the phase info back?

@dlakaplan dlakaplan added the awaiting review This PR needs someone to review it so it can be merged label Nov 24, 2023
@abhisrkckl
Copy link
Contributor

This looks good to me. Shall I merge this?

@dlakaplan
Copy link
Contributor Author

Yes, please.

@abhisrkckl abhisrkckl merged commit c406161 into nanograv:master Dec 7, 2023
9 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.

Remove MCMC_walkthrough.broken?
3 participants