Repository navigation
Marg lnlike - #453
Closed
eshelDror wants to merge 22 commits into
Closed
Marg lnlike#453eshelDror wants to merge 22 commits into
eshelDror wants to merge 22 commits into
Conversation
… resume fits without saving
sblunt
reviewed
Nov 4, 2026
| def apply(self, param_arr, jitter_arr=None, calculated_values={}): | ||
| pass | ||
|
|
||
| class Marg1(Marginalizer): |
Owner
There was a problem hiding this comment.
It would be nice to put these test classes in the appropriate test file instead of the main code
sblunt
reviewed
Nov 4, 2026
| + np.diag(self.covar_seps_pas, k=self.n_obs) | ||
| + np.diag(self.covar_seps_pas, k=-self.n_obs) | ||
| ) | ||
| self.W_inv = np.linalg.inv(self.W) |
sblunt
reviewed
Nov 4, 2026
| MARG_PARAMS = ["sma1", "pan1"] | ||
| QUANT_TYPES = ["seppa"] | ||
| LNLIKE_TYPE = "chi2" | ||
|
|
Owner
There was a problem hiding this comment.
I know this is on your todo list but just reminder to include the docstrings
sblunt
reviewed
Nov 4, 2026
| fs (np.array of float): (defined in \ref{eq:f_and_g} in PASP review), values at observation epochs | ||
| gs (np.array of float): (defined in \ref{eq:f_and_g} in PASP review), values at observation epochs | ||
| W: 2n x 2n covariance matrix corresponding to observations y | ||
|
|
sblunt
reviewed
Nov 4, 2026
| W: 2n x 2n covariance matrix corresponding to observations y | ||
|
|
||
| Returns: | ||
| float: log(abs(determinant of cov matrix)) |
sblunt
reviewed
Nov 4, 2026
|
|
||
| _, logabsdet_covmatrix = np.linalg.slogdet( | ||
| cov_matrix | ||
| ) # NOTE: the 2pi factor in the APW paper is constant; doesn't affect overall lnlike |
Owner
There was a problem hiding this comment.
this comment was more for myself-- maybe instead we say "constant factor of 2pi ignored"
sblunt
reviewed
Nov 4, 2026
| def lnlike(y, X, beta_hat, W, W_inv=None, add_error_norm=False): | ||
| """ | ||
| Compute log likelihood, excluding volume in marginalization integral (first two terms in \ref{eq:marg_like} in | ||
| PASP review): |
Owner
There was a problem hiding this comment.
We should assume readers don't know what the PASP review is-- maybe give a little more context "PASP review by Blunt 2026"
sblunt
reviewed
Nov 4, 2026
| X: 2*n_obs x 2 design matrix | ||
| beta_hat: length 2 array of conditional MAP values of sma and pan (respectively) | ||
| W: 2n x 2n covariance matrix corresponding to observations y | ||
| add_error_term: if True, include the -1/2 log|W| term (needed if fitting for jitter). Default False.as_integer_ratio |
Owner
|
all code pulled in in PR #459 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.