term_ri.f_ig()

Contents

term_ri.f_ig()#

classmethod term_ri.f_ig(basis, fname='ri', ig_concentration=1.0, ig_scale=0.005, inference=MCMCSpec(kernel=<class 'liesel.goose.nuts.NUTSKernel'>, kernel_kwargs={}, kernel_group=None, jitter_dist=None, jitter_method='additive'), variance_value=100.0, variance_jitter_dist=None, coef_name=None)[source]#

Construct a random-intercept term with an inverse-gamma variance prior.

This convenience constructor creates a term_ri and attaches a variance parameter with an Inverse-Gamma prior. The variance is transformed into a scale variable and used to scale the group coefficients. An MCMC inference specification for the variance is set up using a Gibbs kernel by default.

Parameters:
  • basis (Basis) – Basis encoding integer group labels.

  • fname (str) – Prefix used to build the term name (default 'ri'). (default: 'ri')

  • ig_concentration (float) – Shape parameter for the Inverse-Gamma prior on the variance. (default: 1.0)

  • ig_scale (float) – Scale parameter for the Inverse-Gamma prior on the variance. (default: 0.005)

  • inference (Any) – Inference specification for the coefficient variable. (default: MCMCSpec(kernel=<class 'liesel.goose.nuts.NUTSKernel'>, kernel_kwargs={}, kernel_group=None, jitter_dist=None, jitter_method='additive'))

  • variance_value (float) – Initial value for the variance parameter. (default: 100.0)

  • coef_name (str | None) – Optional human-readable name for the coefficient variable. (default: None)

Return type:

term_ri

Returns:

  • A configured random-intercept term with variance and scale

  • variables attached.