SymmetricallyBoundedScalar

SymmetricallyBoundedScalar#

class liesel_ptm.SymmetricallyBoundedScalar(allowed_dist_from_one, name='', a=15.0, b=15.0, bijector=<tfp.bijectors.Sigmoid 'sigmoid' batch_shape=[] forward_min_event_ndims=0 inverse_min_event_ndims=0 dtype_x=? dtype_y=?>)[source]#

Bases: Var

Class for defining a scalar \(\omega\) with symmetrically bounded support around 1.

With this class, the support of this scalar is \(\omega \in [1 - d, 1 + d]\). The scalar itself is specified as \(\omega = 1 + d(1 - 2\nu)\), where \(\nu \sim \text{Beta}(a, b)\). This ensures that the boundaries of support are enforced.

Parameters:
  • allowed_dist_from_one (float) – The allowed distance from 1, which is written as \(d\) in the description above.

  • name (str) – Name of the variable. (default: '')

  • a (float | Var | Node) – Parameters \(a, b\) of the beta prior for the variable \(\nu\). (default: 15.0)

  • b (float | Var | Node) – Parameters \(a, b\) of the beta prior for the variable \(\nu\). (default: 15.0)

  • bijector (Bijector | None) – A tensorflow bijector instance. If a bijector is supplied, the variable \(\nu\) 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.Sigmoid 'sigmoid' batch_shape=[] forward_min_event_ndims=0 inverse_min_event_ndims=0 dtype_x=? dtype_y=?>)

Methods

predict

Returns posterior samples of this variable.

Attributes

unit_var

The variable \(\nu \sim \text{Beta}(a, b)\).

transformed

The transformed variable (if any).