pangolin.interface.lognormal

Contents

pangolin.interface.lognormal#

pangolin.interface.lognormal(mu, sigma)#

Create a Lognormal distributed RV (Wikipedia).

This function belongs to the default interface. Thus, all arguments must either be scalar or mutually broadcastable using simple broadcasting, unless changed within an overload() block.

Parameters:
  • mu (RVLike) – logarithm of location.

  • sigma (RVLike) – logarithm of scale (not sigma squared!).

Returns:

ir.RV – RV whose operation is pangolin.ir.Lognormal 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

>>> import pangolin.interface as pi
>>> x = pi.lognormal(0.1, 0.2)
>>> x
RV(Lognormal(), RV(Constant(0.1)), RV(Constant(0.2)))
>>> x.shape
()
>>> y = pi.lognormal([0.1, 0.1], 0.2)
>>> y
RV(VMap(Lognormal(), [0, None], 2), RV(Constant([0.1,0.1])), RV(Constant(0.2)))
>>> y.shape
(2,)