Skip to content

Commit

Permalink
Transpose before calculating covariance in test
Browse files Browse the repository at this point in the history
np.cov expects rows to be parameters and columns to be realizations
  • Loading branch information
dafeda committed Nov 4, 2024
1 parent 8c679c1 commit 64a6467
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/ert/ui_tests/cli/test_field_parameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,15 @@ def test_field_param_update_using_heat_equation(heat_equation_storage):
prior_covariance = np.cov(
prior_result.values.reshape(
prior.ensemble_size, param_config.nx * param_config.ny * param_config.nz
)
),
rowvar=False,
)
posterior_covariance = np.cov(
posterior_result.values.reshape(
posterior.ensemble_size,
param_config.nx * param_config.ny * param_config.nz,
)
),
rowvar=False,
)
# Check that generalized variance is reduced by update step.
assert np.trace(prior_covariance) > np.trace(posterior_covariance)
Expand Down

0 comments on commit 64a6467

Please sign in to comment.