Skip to content

Forward a custom GPConfig (prior / node distributions) through make_and_fit_model #73

@SamuelBrand1

Description

@SamuelBrand1

Summary

make_and_fit_model builds the AutoGP.GPModel forwarding only n_particles, so callers
can't customise the AutoGP prior — neither the kernel-structure distribution
(node_dist_leaf/node_dist_nocp/node_dist_cp) nor the hyperparameter priors
(prior[:gamma], prior[:period], prior[:wildcard]). AutoGP.GPModel already takes a
config::AutoGP.GP.GPConfig keyword; we just don't expose one.

Current

function make_and_fit_model(data::TData; n_particles = 8, smc_data_proportion = 0.1,
        n_mcmc = 200, n_hmc = 50, kwargs...)
    model = AutoGP.GPModel(data.ds, data.y; n_particles = n_particles)
    ...
end

Proposed

Add a config keyword (default AutoGP.GPConfig(), so existing behaviour is unchanged) and
forward it:

function make_and_fit_model(data::TData; n_particles = 8, smc_data_proportion = 0.1,
        n_mcmc = 200, n_hmc = 50, config::AutoGP.GPConfig = AutoGP.GPConfig(), kwargs...)
    model = AutoGP.GPModel(data.ds, data.y; n_particles = n_particles, config = config)
    ...
end

Motivation

Building a parameter-recovery / configuration test suite for EpiAutoGP surfaced two needs that
require a custom GPConfig:

  1. Re-centre the period prior on epidemiological seasonality. The default
    prior[:period] = LogNormal(μ = -1.5, σ = 1) medians ≈ 0.22 in AutoGP's normalized-time
    units (≈ 80 days for a ~1-year daily window) — not the annual / semi-annual cycle that
    respiratory disease actually has. In production we'd set prior[:period] so the periodic
    component concentrates near ~1 year (and perhaps ½ year).

  2. Recover squared-exponential structure. AutoGP's node_dist_* give SquaredExponential
    (and Constant) zero prior mass, so a squared-exponential signal is recoverable only as a
    GammaExponential with γ → 2. Investigating whether to enable SquaredExponential and/or
    loosen the gamma prior needs a custom GPConfig.

Both are GPConfig changes we currently can't pass through make_and_fit_model.

Notes

  • Backwards compatible: the default config = AutoGP.GPConfig() reproduces current behaviour.
  • A small helper to build a GPConfig from a TOML/dict of overrides would be a nice follow-up
    for config-driven runs, but the one-line keyword passthrough is the core ask.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions