Closed micheles closed 2 weeks ago
If we need to switch to cholesky, there are existing helper functions in conditioned_gmfs.py that should help with ensuring that the covariance matrices are positive (semi-) definite, eg.: https://github.com/gem/oq-engine/blob/engine-3.20/openquake/hazardlib/calc/conditioned_gmfs.py#L835-L901
(copied from statsmodels.stats.correlation_tools.cov_nearest)
By introducing a correlation cutoff. Also changed the method of
multivariate_normal
tocholesky
since the numpy docs sayThis is critical because the results of conditioned GMFs were machine-dependent, i.e. not reproducible at all. See the huge change in
openquake/qa_tests_data/scenario_risk/conditioned/expected/aggrisk.csv
. The aggrisk is now stable even if I change the cutoff:gives always the same results within the precision of the view.