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

Don't return constrained posterior in save_posterior #63

Merged
merged 1 commit into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions src/emulate_sample.jl
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,6 @@ Returns the samples in constrained (physical) parameter space.
"""
function save_posterior(mcmc, chain; filename = "samples.jld2")
posterior = MarkovChainMonteCarlo.get_posterior(mcmc, chain)
constrained_posterior = transform_unconstrained_to_constrained(
posterior,
MarkovChainMonteCarlo.get_distribution(posterior),
)
JLD2.save_object(filename, posterior)
return constrained_posterior
return posterior
end
2 changes: 0 additions & 2 deletions test/test_emulate_sample.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,3 @@ emulator = CAL.gp_emulator(input_output_pairs, y_noise_cov)
@test mean(chain.value[1:100000]) ≈ 4.19035299 rtol = 0.0001

constrained_posterior = CAL.save_posterior(mcmc, chain)
@test mean(constrained_posterior["equator_pole_temperature_gradient_wet"]) ≈
66.046965013381 rtol = 0.0001
Loading