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:
-
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).
-
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.
Summary
make_and_fit_modelbuilds theAutoGP.GPModelforwarding onlyn_particles, so callerscan'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.GPModelalready takes aconfig::AutoGP.GP.GPConfigkeyword; we just don't expose one.Current
Proposed
Add a
configkeyword (defaultAutoGP.GPConfig(), so existing behaviour is unchanged) andforward it:
Motivation
Building a parameter-recovery / configuration test suite for EpiAutoGP surfaced two needs that
require a custom
GPConfig:Re-centre the period prior on epidemiological seasonality. The default
prior[:period] = LogNormal(μ = -1.5, σ = 1)medians ≈ 0.22 in AutoGP's normalized-timeunits (≈ 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 periodiccomponent concentrates near ~1 year (and perhaps ½ year).
Recover squared-exponential structure. AutoGP's
node_dist_*giveSquaredExponential(and
Constant) zero prior mass, so a squared-exponential signal is recoverable only as aGammaExponentialwith γ → 2. Investigating whether to enableSquaredExponentialand/orloosen the
gammaprior needs a customGPConfig.Both are
GPConfigchanges we currently can't pass throughmake_and_fit_model.Notes
config = AutoGP.GPConfig()reproduces current behaviour.GPConfigfrom a TOML/dict of overrides would be a nice follow-upfor config-driven runs, but the one-line keyword passthrough is the core ask.