Skip to contents

Display the default prior specifications used for each model family. Useful for understanding what priors are applied before fitting and as a starting point for customization.

Usage

priors_default(family = NULL, spatial = FALSE, temporal = FALSE)

Arguments

family

A tulpaRatio family object (e.g., ratiod_negbin_negbin()). If NULL (default), shows defaults for all families.

spatial

Logical; if TRUE, include spatial priors. Default FALSE.

temporal

Logical; if TRUE, include temporal priors. Default FALSE.

Value

Invisibly returns a ratiod_priors object with the defaults. Primarily called for its side effect of printing.

Details

Default priors in tulpaRatio follow these principles:

  • Fixed effects (beta): Normal(0, 2.5) - weakly informative, allows coefficients roughly in [-5, 5] on the link scale.

  • Random effect SD (sigma): PC prior with P(sigma > 1) = 0.01 - favors simpler models with smaller variance components.

  • Overdispersion (phi): PC prior with P(phi > 10) = 0.01 - regularizes toward Poisson (phi -> Inf means less overdispersion in NB2).

  • Temporal correlation (rho): Beta(2, 2) - symmetric prior centered at 0.5, appropriate for AR(1) correlation.

  • Spatial mixing (rho_spatial): Beta(1, 1) = Uniform(0, 1) - no prior preference for structured vs. unstructured spatial variation.

See also

ratiod_priors() for creating custom priors

Examples

# Show defaults for negbin_negbin family
priors_default(ratiod_negbin_negbin())
#> Default priors for negbin_negbin family
#> ===================================== 
#> 
#> Fixed effects (beta):
#>   Normal(0.00, 2.50)
#>   Used for: All regression coefficients in numerator and denominator
#> 
#> Random effect SD (sigma):
#>   PC prior: P(x > 1.00) = 0.010
#>     => Exponential(4.605)
#>   Used for: Standard deviation of group-level effects
#> 
#> Overdispersion (phi):
#>   PC prior: P(x > 10.00) = 0.010
#>     => Exponential(0.461)
#>   Used for: NB2 size parameter (larger = less overdispersion)
#> 
#> To customize, use ratiod_priors():
#>   priors <- ratiod_priors(
#>     beta = prior_normal(0, 1),
#>     sigma = prior_pc(U = 0.5, alpha = 0.01)
#>   )

# Show defaults for binomial family
priors_default(ratiod_binomial())
#> Default priors for binomial_fixed family
#> ====================================== 
#> 
#> Fixed effects (beta):
#>   Normal(0.00, 2.50)
#>   Used for: All regression coefficients in numerator and denominator
#> 
#> Random effect SD (sigma):
#>   PC prior: P(x > 1.00) = 0.010
#>     => Exponential(4.605)
#>   Used for: Standard deviation of group-level effects
#> 
#> To customize, use ratiod_priors():
#>   priors <- ratiod_priors(
#>     beta = prior_normal(0, 1),
#>     sigma = prior_pc(U = 0.5, alpha = 0.01)
#>   )

# Show defaults including spatial parameters
priors_default(ratiod_negbin_negbin(), spatial = TRUE)
#> Default priors for negbin_negbin family
#> ===================================== 
#> 
#> Fixed effects (beta):
#>   Normal(0.00, 2.50)
#>   Used for: All regression coefficients in numerator and denominator
#> 
#> Random effect SD (sigma):
#>   PC prior: P(x > 1.00) = 0.010
#>     => Exponential(4.605)
#>   Used for: Standard deviation of group-level effects
#> 
#> Overdispersion (phi):
#>   PC prior: P(x > 10.00) = 0.010
#>     => Exponential(0.461)
#>   Used for: NB2 size parameter (larger = less overdispersion)
#> 
#> Spatial mixing (rho_spatial):
#>   Beta(1.00, 1.00)  [mean = 0.50]
#>   Used for: BYM2 mixing proportion (structured vs. unstructured)
#> 
#> To customize, use ratiod_priors():
#>   priors <- ratiod_priors(
#>     beta = prior_normal(0, 1),
#>     sigma = prior_pc(U = 0.5, alpha = 0.01)
#>   )

# Show defaults for all families
priors_default()
#> Default priors for ratio models
#> ================================
#> 
#> These defaults apply to all families unless overridden.
#> 
#> Fixed effects (beta):
#>   Normal(0, 2.5)
#>   Interpretation: Coefficients roughly in [-5, 5] on link scale
#>   Customization: prior_normal(mean, sd)
#> 
#> Random effect SD (sigma):
#>   PC prior: P(sigma > 1) = 0.01
#>   Interpretation: Favors smaller variance components
#>   Customization: prior_pc(U, alpha) or prior_half_normal(sd)
#> 
#> Overdispersion (phi) [negbin/poisson_gamma only]:
#>   PC prior: P(phi > 10) = 0.01
#>   Interpretation: Regularizes toward Poisson
#>   Customization: prior_pc(U, alpha) or prior_gamma(shape, rate)
#> 
#> Family-specific notes:
#>   negbin_negbin: Uses phi for both numerator and denominator
#>   binomial: No overdispersion parameter (unless beta_binomial)
#>   poisson_gamma: Uses phi for gamma shape parameter

# Use as starting point for customization
my_priors <- priors_default(ratiod_poisson_gamma())
#> Default priors for poisson_gamma family
#> ===================================== 
#> 
#> Fixed effects (beta):
#>   Normal(0.00, 2.50)
#>   Used for: All regression coefficients in numerator and denominator
#> 
#> Random effect SD (sigma):
#>   PC prior: P(x > 1.00) = 0.010
#>     => Exponential(4.605)
#>   Used for: Standard deviation of group-level effects
#> 
#> Overdispersion (phi):
#>   PC prior: P(x > 10.00) = 0.010
#>     => Exponential(0.461)
#>   Used for: Gamma shape parameter for effort/exposure
#> 
#> To customize, use ratiod_priors():
#>   priors <- ratiod_priors(
#>     beta = prior_normal(0, 1),
#>     sigma = prior_pc(U = 0.5, alpha = 0.01)
#>   )
my_priors$beta <- prior_normal(0, 1)  # Tighter prior on fixed effects