diff --git a/tests/integration/test_monte_carlo_thevenin.py b/tests/integration/test_monte_carlo_thevenin.py index f9d024ed8..e0c5f2d2b 100644 --- a/tests/integration/test_monte_carlo_thevenin.py +++ b/tests/integration/test_monte_carlo_thevenin.py @@ -100,6 +100,7 @@ def map_estimate(self, posterior): "max_unchanged_iterations": 35, "absolute_tolerance": 1e-7, "sigma0": [3e-4, 3e-4], + "verbose": True, } optim = pybop.CMAES(posterior, **common_args) results = optim.run() @@ -127,17 +128,18 @@ def test_sampling_thevenin(self, sampler, posterior, map_estimate): x0 = np.clip(map_estimate + np.random.normal(0, 1e-3, size=2), 1e-4, 1e-1) common_args = { "log_pdf": posterior, - "chains": 3, - "warm_up": 550, + "chains": 2, + "warm_up": 100, "cov0": [2e-3, 2e-3], - "max_iterations": 2000, + "max_iterations": 1050, "x0": x0, } # construct and run sampler = sampler(**common_args) if isinstance(sampler, SliceRankShrinkingMCMC): - sampler._samplers[0].set_hyper_parameters([1e-3]) + for i, _j in enumerate(sampler._samplers): + sampler._samplers[i].set_hyper_parameters([1e-3]) chains = sampler.run() # Test PosteriorSummary @@ -146,7 +148,7 @@ def test_sampling_thevenin(self, sampler, posterior, map_estimate): np.testing.assert_array_less(0, ess) if not isinstance(sampler, RelativisticMCMC): np.testing.assert_array_less( - summary.rhat(), 1.2 + summary.rhat(), 1.5 ) # Large rhat, to enable faster tests # Assert both final sample and posterior mean diff --git a/tests/integration/test_spm_parameterisations.py b/tests/integration/test_spm_parameterisations.py index 427534522..1e00d7d77 100644 --- a/tests/integration/test_spm_parameterisations.py +++ b/tests/integration/test_spm_parameterisations.py @@ -15,7 +15,7 @@ def setup(self): self.sigma0 = 0.002 self.ground_truth = np.clip( np.asarray([0.55, 0.55]) + np.random.normal(loc=0.0, scale=0.05, size=2), - a_min=0.4, + a_min=0.425, a_max=0.75, ) @@ -124,7 +124,7 @@ def optim(self, optimiser, model, parameters, cost, init_soc): "max_unchanged_iterations": 55, "sigma0": [0.05, 0.05, 1e-3] if isinstance(cost, pybop.GaussianLogLikelihood) - else 0.02, + else 0.05, } if isinstance(cost, pybop.LogPosterior):