Skip to content

Commit 5cc03e9

Browse files
test: remove seasonal xfail and tighten R equivalence tolerances
State-space seasonal smoother achieves <0.1% relative error vs R bsts, far exceeding the original ±5% tolerance with dummy-variable approach. Tolerance changes: - seasonal: ±5% → ±1% (actual: <0.1%) - basic/strong_effect CI: ±1.5% → ±1.0% (actual: <0.5%) - Remove xfail from TestEquivalenceSeasonal (all 5 tests pass) All 33 numerical equivalence tests pass with tightened tolerances.
1 parent a7fac22 commit 5cc03e9

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

tests/test_numerical_equivalence.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,14 @@
4343
}
4444

4545
TOL_POINT = 0.03 # ±3% for point estimates
46-
# ±1.5% for no-covariates CI bounds
47-
# (convergence ~0.83%, MCMC variance ±0.5%)
48-
TOL_CI_NO_COV = 0.015
46+
# ±1.0% for no-covariates CI bounds
47+
# (actual error ~0.44%, MCMC variance margin included)
48+
TOL_CI_NO_COV = 0.01
4949
TOL_CI_COV = 0.01 # ±1% after aligning with the R static regression prior
5050
TOL_CI_PHASE2 = 0.03 # explicit Phase 2 benchmark for covariate CI bounds
51-
TOL_POINT_SEASONAL = 0.05
52-
TOL_CI_SEASONAL = 0.05
51+
# State-space seasonal (DK simulation smoother): actual error < 0.1%
52+
TOL_POINT_SEASONAL = 0.01
53+
TOL_CI_SEASONAL = 0.01
5354
ABS_TOL_NO_EFFECT = 2.0 # absolute tolerance when true_effect=0
5455

5556

@@ -300,10 +301,6 @@ def test_p_value_significance(self):
300301
_assert_significance(py, fixture["r_output"])
301302

302303

303-
@pytest.mark.xfail(
304-
reason="seasonal model migrating from static regressors to state-space (R bsts compat)",
305-
strict=False,
306-
)
307304
class TestEquivalenceSeasonal:
308305
SCENARIO = "seasonal"
309306

0 commit comments

Comments
 (0)