Skip to content

Implement Stacking module wrapping ArviZ.jl + Optim.jl #27

Description

@jc-macdonald

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

  • All three functions exported and documented
  • Weights sum to 1, all non-negative
  • Round-trip test: stacking uniform models gives uniform weights

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions