Skip to content

Marg gaia - #459

Merged
sblunt merged 48 commits into
sblunt:v4from
eshelDror:marg_gaia
Nov 17, 2026
Merged

sblunt merged 48 commits into
sblunt:v4from
eshelDror:marg_gaia

Conversation

@eshelDror

Copy link
Copy Markdown
Collaborator

No description provided.

Comment thread orbitize/marginalizer.py Outdated

Currently only applicable to 1 massive companion.
REQ_PARAMS = ["ecc1", "inc1", "aop1", "tau1", "per1", "m1"] + ["dr4_jitter"] if fitting jitter
MARG_PARAMS = ["pm_ra", "pm_dec", "alpha0", "delta0", "plx", "u", "v"]

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

define u and v somewhere in this docstring

Comment thread orbitize/marginalizer.py Outdated

log_conditional_prob = -0.5 * res.T @ precision_matrix @ res - 0.5 * logabsdet_covmatrix

log_conditional_prob -= (n_obs/2) * np.log(2*np.pi) # Figure out if half n_obs is right

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

half n_obs shouldn't matter for the mcmc since it's a constant wrt the fitting parameters

@eshelDror

Copy link
Copy Markdown
Collaborator Author

I think all feedback has been addressed except abstraction of automatic marginalization construction.
When running the test to make sure loglikelihoods match the non-marginalized values I ran into issues and made some changes.

  1. I changed the m1 parameter to mfrac1=m1/mtot1 to make negative m0 impossible. This means a prior reweighing is also needed for mfrac1 -> m1 if a prior on m1 is desired.
  2. I moved the prior reweighing out of the marginalizers and into system, prior and sampler. I was doing this when I thought it might be the issue (it wasn't), but I think it's cleaner.
  3. 180 was being added to aop instead of pi (to get aop*), the order of marginalized parameters in the MARG_PARAMS list was not matching the order in the design matrix D so the parameters were being assigned to the wrong indexes, and I believe I was missing a negative for the As and Bs (I still need to go through the derivation to make sure this is right, but it seems so empirically).
    The loglikelihoods are still not matching but now the difference is O(1k) instead of O(1m). The posteriors look pretty similar to me.

@eshelDror

Copy link
Copy Markdown
Collaborator Author

It was tau reference epoch. All the previous tests with non-Gaia OFTeI marginalization happened to be using a reference epoch of 0. Marginalization tests now pass.

@eshelDror

Copy link
Copy Markdown
Collaborator Author

test_OFTeI_gaia is only failing due to the extra negative sign in the 'true' calculation and which is fixed in #462

@sblunt
sblunt merged commit a205b6b into sblunt:v4 Nov 17, 2026
0 of 5 checks passed
@sblunt
sblunt deleted the marg_gaia branch November 17, 2026 22:54
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