neighbayes.models.priors.MultilevelPriors¶
-
class neighbayes.models.priors.MultilevelPriors(beta_mu=
None, beta_sigma=None, sigma2_alpha=2.0, sigma2_beta=None, nu=4.0, rho_lower=None, rho_upper=None, sigma_nu=3.0, sigma_scale=None, level_beta_mu=None, level_beta_sigma=None)[source]¶ Priors for
neighbayes.models.Multilevel.- beta_mu, beta_sigma
Normal prior on the units’ coefficients \(\beta_0\); default Gelman et al. (2008).
- sigma2_alpha, sigma2_beta
\(\sigma_0^2 \sim \text{Inv-}\Gamma\), the data-informed prior of the single-level models (LeSage).
sigma2_betadefaults to the pooled variance ofywithin level-1 groups, the units’ share ofVar(y):Var(y)itself also counts the upper levels’ variance, and the prior shifts the posterior mean of \(\sigma_0^2\) by about2 * sigma2_beta / n, which with strong upper levels was several posterior standard deviations.
- rho_lower, rho_upper
Uniform bounds on every level’s autoregressive parameter (ρ or λ); default each graph’s stability bounds,
(-1, 1)when row-standardized.
- sigma_nu, sigma_scale
Half-t prior on each upper level’s innovation sd, \(\sigma_\ell \sim \text{half-}t_\nu(0, A)\).
sigma_scale(A) defaults tosd(y): every level’s effects are in the outcome’s units.nu = 3regularizes more than the half-Cauchy when a level has few groups (a few dozen states, say). NUTS and Gibbs use the same prior.
- level_beta_mu, level_beta_sigma
Overrides of the Normal prior on an upper level’s coefficients, keyed by level number or name, e.g.
{"county": 1.0}. The default is Gelman et al. (2008) with the outcome’s scale and each level’s covariates.
-
__init__(beta_mu=
None, beta_sigma=None, sigma2_alpha=2.0, sigma2_beta=None, nu=4.0, rho_lower=None, rho_upper=None, sigma_nu=3.0, sigma_scale=None, level_beta_mu=None, level_beta_sigma=None)[source]¶
Methods
__init__([beta_mu, beta_sigma, ...])Attributes