Informar intervalos PIM no estimables

This commit is contained in:
2026-12-02 23:04:01 -06:00
parent 8a860c698f
commit d392cc02a5
5 changed files with 95 additions and 6 deletions
+5 -1
View File
@@ -81,7 +81,11 @@ def test_predictions_match_the_current_models(name):
for ours, theirs in [("probability", "probabilidad"), ("ci_low", "ic_bajo"),
("ci_high", "ic_alto")]: # fmt: skip
if theirs in both:
np.testing.assert_allclose(both[ours], both[theirs], rtol=RTOL, atol=0)
# Older reference intervals include non-estimable covariance estimates. Preserve
# parity for point estimates and for intervals that remain estimable.
comparable = both[ours].notna() if ours != "probability" else np.ones(len(both), bool)
np.testing.assert_allclose(both.loc[comparable, ours], both.loc[comparable, theirs],
rtol=RTOL, atol=0)
if spec.method != "logistic regression":
assert (pd.to_datetime(both["index_date"]) == pd.to_datetime(both["fecha_indice"])).all()