Skip to content

Commit

Permalink
Don't return constrained posterior in save_posterior
Browse files Browse the repository at this point in the history
  • Loading branch information
nefrathenrici committed Mar 6, 2024
1 parent cbb51f8 commit ce15cdb
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
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

0 comments on commit ce15cdb

Please sign in to comment.