Closed tilmantroester closed 7 months ago
Apart from the missing test and mypy errors, this can be reviewed I think @marcpaterno @vitenti
@tilmantroester , please, take a look on the modification to see if you agree with the current version.
Thanks for the help! I think adding noise to the prediction should be factored out of the functionality of saving the prediction. That way the functionality can also be used to save predictions+noise during sampling and would address #323.
@tilmantroester , what about making it optional? Take a look on the last commits.
I'd move make_realization
to Likelihood
or GaussFamily
. Other likelihoods should still be able to save theory predictions, even if the sampling from the likelihood isn't implemented yet. We could add an abstract method Likelihood.sample
, with the Gaussian and Student-T likelihoods implementing the specifics (I have the math for the latter).
I'd move
make_realization
toLikelihood
orGaussFamily
. Other likelihoods should still be able to save theory predictions, even if the sampling from the likelihood isn't implemented yet. We could add an abstract methodLikelihood.sample
, with the Gaussian and Student-T likelihoods implementing the specifics (I have the math for the latter).
I think that we came up with the same solution, I just implemented your suggestion. Please, take a look.
@tilmantroester I think that it is now complete. Please tell me if you think there is something else to do here, otherwise we will review and merge it during our next Firecrown meeting.
Looks good to me, thanks!
Attention: 3 lines
in your changes are missing coverage. Please review.
Comparison is base (
b978402
) 95.22% compared to head (ef3b08e
) 95.42%.
Files | Patch % | Lines |
---|---|---|
firecrown/likelihood/gauss_family/gauss_family.py | 96.66% | 2 Missing :warning: |
firecrown/likelihood/likelihood.py | 75.00% | 1 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
This PR addresses #346.
It writes the predicted theory vector into a sacc object, replacing the corresponding data point. By default the method raises an error if the sacc object contains data points that are not being overwritten by the predictions to avoid inconsistency.
Future additions to the functionality would be to draw a sample from the likelihood, instead of using the (zero-noise) theory prediction.
One discussion point is how to store the predictions. At the moment, only
TwoPoint
does this and usespredicted_statistic_
for this. I've usedpredicted_statistic_
for now for compatibility with existing code but I wouldn't mind renaming this totheory_vector
to match thedata_vector
.The test doesn't cover the checking of the prediction against the content of the sacc object yet.