Summary
Port stacking.py for Bayesian model stacking and score-weighted ensembling.
Functions to Implement
| Function |
Description |
Julia deps |
stack_bayesian(loo_dict) |
LOO/WAIC stacking weights |
ArviZ.jl compare() |
stack_scores(scores, directions) |
Simplex-constrained score optimization |
Optim.jl (constrained LBFGS or IPNewton) |
ensemble_predict(predictions, weights) |
Weighted average of model predictions |
LinearAlgebra (stdlib) |
Design Notes
- ArviZ.jl is a meta-package providing
InferenceObjects.jl, MCMCDiagnosticTools.jl, PosteriorStats.jl.
stack_scores needs a simplex constraint (weights ≥ 0, sum = 1). Optim.jl supports box constraints; project onto simplex after each step, or use a reparameterization.
- Package extensions: ArviZ.jl dep only loaded when user has it.
Acceptance Criteria
Summary
Port
stacking.pyfor Bayesian model stacking and score-weighted ensembling.Functions to Implement
stack_bayesian(loo_dict)compare()stack_scores(scores, directions)ensemble_predict(predictions, weights)Design Notes
InferenceObjects.jl,MCMCDiagnosticTools.jl,PosteriorStats.jl.stack_scoresneeds a simplex constraint (weights ≥ 0, sum = 1). Optim.jl supports box constraints; project onto simplex after each step, or use a reparameterization.Acceptance Criteria