pangolin.interface.Interface.normal_prec

pangolin.interface.Interface.normal_prec#

Interface.normal_prec(mu, tau)[source]#

Create a NormalPrec distributed RV (Wikipedia).

All arguments must either be scalar or mutually broadcastable according to the broadcasting policy selected when constructing the interface or within an overload block.

Parameters:
  • mu (RVLike) – location / mean.

  • tau (RVLike) – precision / inverse variance.

Returns:

ir.RV – RV whose operation is pangolin.ir.NormalPrec when all parents are scalar, or one or more nested pangolin.ir.VMap operations around that type when broadcasting is required. The operation has 2 parents.

Return type:

RV

Examples

>>> pi = Interface()
>>> x = pi.normal_prec(0.1, 0.2)
>>> x
RV(NormalPrec(), RV(Constant(0.1)), RV(Constant(0.2)))
>>> x.shape
()
>>> y = pi.normal_prec([0.1, 0.1], 0.2)
>>> y
RV(VMap(NormalPrec(), [0, None], 2), RV(Constant([0.1,0.1])), RV(Constant(0.2)))
>>> y.shape
(2,)