Bayesian priors for econometricians
Priors constrain and regularise the conditional model. Report their support, scale and influence on conclusions. They do not establish causal identification or guarantee unbiased estimates.
Support and scale
A HalfNormal prior assigns zero probability to negative values. The posterior
cannot override that support restriction. A larger scale allows larger positive
values, while preserving the same sign restriction. A LogNormal prior also
restricts the parameter to positive values.
For a continuously positive-constrained coefficient, the posterior probability of being above zero is one by construction. It supplies no independent evidence for the sign. Assess practically meaningful effect thresholds and sensitivity to assumptions that permit other signs when scientifically appropriate.
Regularisation can reduce variance while introducing bias relative to a chosen sampling estimand. The trade-off depends on the data and model. Calling a prior weakly informative does not remove that trade-off.
Relation to classical methods
A normal prior on regression coefficients gives a ridge-type penalty in a posterior-mode calculation. A Laplace prior gives an L1-type penalty under the corresponding likelihood and scaling. Full posterior inference also represents uncertainty beyond the mode.
Some unpenalised estimates coincide with posterior modes under suitable flat priors. This does not make every frequentist procedure equivalent to Bayesian inference. An improper flat prior is not a probability distribution, and its posterior need not be proper.
Current ammm configuration
Python priors use pymc_extras.prior.Prior. The following declarations specify
support and scale; their suitability depends on the model’s scaling.
from pymc_extras.prior import Prior
beta = Prior("HalfNormal", sigma=2)
alpha = Prior("Beta", alpha=1, beta=3)
lam = Prior("Gamma", alpha=3, beta=1)
In current YAML, transform priors belong under the selected transform. General
model priors use the top-level priors mapping. This model configuration can
be passed to the builder with compatible X and y.
data:
date_column: date
target:
column: revenue
type: revenue
media:
channels: [channel_1, channel_2, channel_3]
adstock:
type: geometric
l_max: 4
priors:
alpha: {distribution: Beta, alpha: 1, beta: 3}
saturation:
type: logistic
priors:
beta: {distribution: HalfNormal, sigma: 2}
lam: {distribution: Gamma, alpha: 3, beta: 1}
priors:
intercept: {distribution: Normal, mu: 0, sigma: 2}
See Priors and Configuration
for estimator-specific keys and dimensions. Named FE/CRE have different prior
contracts from unlabelled models. Older custom_priors or external
boundaries schemas are not accepted as current builder roots.
Choosing prior strength
Sample size and channel count alone do not determine identification or prior influence. Two hundred weeks of highly correlated spending may contain little information about separate channel effects. A smaller dataset can contain useful independent variation, although precision remains limited.
Assess the transformed design, spend range, dependence, baseline flexibility and external evidence. Compare plausible prior scales and functional choices. Keep sign restrictions separate from decisions about regularisation strength. A lift study informs only the estimands and settings to which it credibly applies; it does not make every prior choice harmless.
Assessing prior influence
Compare each parameter’s prior marginal with its posterior marginal. Compare prior and posterior predictive distributions separately on the outcome scale. A parameter distribution and an outcome predictive distribution concern different random variables.
A posterior shift or narrowing shows an update under that prior. It does not show that another plausible prior would lead to the same conclusion. Similar prior and posterior marginals can reflect weak information, agreement between data and prior, or model structure. Use explicit prior-sensitivity fits to assess effects on contributions, response curves and recommendations.
The runner can write alternative configurations before fitting. It does not fit them merely by creating the plan. See the prior-sensitivity configuration and Python API.