TermBuilder.init_scale()

TermBuilder.init_scale()#

TermBuilder.init_scale(scale, term_name)[source]#

Initializes a scale variable with a term-related name.

Parameters:
  • scale (Var | ScaleIG | float | Literal['default'] | VarIGPrior) – Scale object.

  • term_name (str) – Name of the term this scale corresponds to. If you supply a liesel.model.Var, you can use the place- holder {x} in its name to allow this method to fill in the term_name.

Return type:

Var

Notes

The behavior depends on the type of the scale argument.

  • If it is "default", the return will be created based on the

    default_scale_fn argument supplied to the TermBuilder upon initialization.

  • If it is a VarIGPrior, the return

    will be scale = sqrt(var), where var ~ InverseGamma(concentration, scale), with concentration and scale given by the VarIGPrior object. For most terms, this will mean that a fitting Gibbs sampler can be automatically set up for var. The exceptions to this rule are ta(), tf(), and tx().

  • If it is a float, the return will be lsl.Var.new_value holding this

    float.

  • If it is a liesel.model.Var object, the return will be this

    object. If you supply a liesel.model.Var, you can use the place- holder {x} in its name to allow this method to fill in an automatically generated name based on the term_name.