VarHalfCauchy

Contents

VarHalfCauchy#

class liesel_ptm.VarHalfCauchy(value, scale, name, bijector=<tfp.bijectors.Softplus 'softplus' batch_shape=[] forward_min_event_ndims=0 inverse_min_event_ndims=0 dtype_x=? dtype_y=?>)[source]#

Bases: Var

A variance parameter with a half Cauchy prior on its square root.

Parameters:
  • value (Any) – Initial value of the variable.

  • scale (float | Var | Node) – Scale parameter of the half Cauchy distribution.

  • name (str) – Name of the variable.

  • bijector (Bijector | None) – A tensorflow bijector instance. If a bijector is supplied, the variable will be transformed using the bijector. This renders the variable itself weak, meaning that it is a deterministic function of the newly created transformed variable. The prior is transferred to this transformed variable and transformed according to the change-of-variables theorem. (default: <tfp.bijectors.Softplus 'softplus' batch_shape=[] forward_min_event_ndims=0 inverse_min_event_ndims=0 dtype_x=? dtype_y=?>)

Notes

Note that the half Cauchy prior is placed not directly on the variance parameter, but on the standard deviation, i.e. the square root of the variance. Futher, the standard deviation is transformed to the positive real line for MCMC sampling using a bijector, which defaults to softplus.

Methods

predict

Returns posterior samples of this variable.

Attributes

scale_param

The scale parameter (if any).

transformed

The transformed variable (if any).