Skip to content

Commit 6046f59

Browse files
committed
Add concentration-space LOO and plotting tools
Introduce a full concentration-space LOO workflow and visualization support. - Add catalax.mcmc.loo: reconstruction of per-draw concentration log-likelihoods for mechanistic and surrogate (rate-based) fits, build_loo_idata, loo(), loo_pointwise(), compare(), and consistency_check(); supports Euler integration variants and options for using measurement errors or reusing sampled noise. - Export LOO functions and new plotting hooks (plot_loo_influence, plot_loo_heatmap) from catalax.mcmc.__init__. - Add plotting utilities in catalax.mcmc.plotting for visualizing per-point Pareto-k / elpd influence and heatmaps, plus related helpers and color scales. - Add convenience methods on HMCResults (loo, compare, loo_pointwise, loo_consistency_check, plot_loo_influence) to call the new LOO API. - Fix likelihood/discrepancy handling in BayesianModel (use HalfNormal prior for sigma and treat sigma_total as sampled sigma rather than sigma**2) to align noise semantics with reconstruction. These changes enable consistent LOO comparison across mechanistic and surrogate-mode fits and provide plotting helpers to inspect high-influence observations.
1 parent 4ff4e6c commit 6046f59

5 files changed

Lines changed: 1382 additions & 4 deletions

File tree

catalax/mcmc/__init__.py

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
11
from .mcmc import run_mcmc, MCMCConfig, BayesianModel, HMC, HMCResults
2-
from .plotting import plot_corner, plot_posterior, plot_trace, plot_forest, summary
2+
from .loo import (
3+
loo,
4+
compare,
5+
consistency_check,
6+
build_loo_idata,
7+
reconstruct_log_likelihood,
8+
loo_pointwise,
9+
LooPointwise,
10+
)
11+
from .plotting import (
12+
plot_corner,
13+
plot_posterior,
14+
plot_trace,
15+
plot_forest,
16+
summary,
17+
plot_loo_influence,
18+
plot_loo_heatmap,
19+
)
320
from .protocols import (
421
PreModel,
522
PostModel,
@@ -35,4 +52,13 @@
3552
"PostModelContext",
3653
"pre_model",
3754
"post_model",
55+
"loo",
56+
"compare",
57+
"consistency_check",
58+
"build_loo_idata",
59+
"reconstruct_log_likelihood",
60+
"loo_pointwise",
61+
"LooPointwise",
62+
"plot_loo_influence",
63+
"plot_loo_heatmap",
3864
]

0 commit comments

Comments
 (0)