pangolin.interface.bernoulli_logit

pangolin.interface.bernoulli_logit#

pangolin.interface.bernoulli_logit(theta)#

Create a BernoulliLogit distributed RV.

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:

theta (RVLike) – logit of probability (unbounded).

Returns:

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

Return type:

RV

Examples

>>> import pangolin.interface as pi
>>> x = pi.bernoulli_logit(0.1)
>>> x
RV(BernoulliLogit(), RV(Constant(0.1)))
>>> x.shape
()
>>> y = pi.bernoulli_logit([0.1, 0.1])
>>> y
RV(VMap(BernoulliLogit(), [0], 2), RV(Constant([0.1,0.1])))
>>> y.shape
(2,)