scvi.distributions.ZeroInflatedLogNormal#
- class scvi.distributions.ZeroInflatedLogNormal(mu, scale, zi_logits, normal_mu=None, validate_args=False)[source]#
Bases:
LogNormalZero-inflated log-normal distribution.
A mixture distribution of a point mass at zero and a log-normal distribution. This is a mixed distribution with discrete support at zero and continuous support over (0, ∞).
In the (
mu,scale,zi_logits) parameterization, samples are generated as follows:\(\pi = \textrm{sigmoid}(\texttt{zi\_logits})\)
\(b \sim \textrm{Bernoulli}(\pi)\)
If \(b = 1\): \(x = 0\)
If \(b = 0\): \(z \sim \textrm{Normal}(\mu, \sigma)\), \(x = \exp(z)\)
The probability mass/density function (mixed discrete-continuous) is:
\[\begin{split}p(x; \mu, \sigma, \pi) = \begin{cases} \pi & \text{if } x = 0 \\ (1 - \pi) \cdot f_{LN}(x) & \text{if } x > 0 \end{cases}\end{split}\]where \(f_{LN}(x; \mu, \sigma) = \frac{1}{x \sigma \sqrt{2\pi}} \exp\left(-\frac{(\ln x - \mu)^2}{2\sigma^2}\right)\) is the log-normal density.
Note: The point mass at \(x = 0\) has probability \(\pi\), and the continuous log-normal component (for \(x > 0\)) has probability \((1-\pi)\).
- Parameters:
- mu
Tensor Mean of the normal distribution in log space.
- scale
Tensor Standard deviation of the normal distribution in log space.
- zi_logits
Tensor Logits scale of zero inflation probability.
- normal_mu
Tensor|None(default:None) Normalized mean expression of the distribution.
- validate_args
bool(default:False) Raise ValueError if arguments do not match constraints.
- mu
Attributes table#
Methods table#
|
Get normalized values. |
|
Log probability. |
|
Sample from the distribution. |
Attributes#
- ZeroInflatedLogNormal.arg_constraints: dict[str, Constraint] = {'loc': Optional(Real()), 'scale': Optional(GreaterThan(lower_bound=0)), 'zi_logits': Optional(Real())}#
- ZeroInflatedLogNormal.mean#
Mean of the zero-inflated distribution.
- ZeroInflatedLogNormal.support = GreaterThanEq(lower_bound=0.0)#
- ZeroInflatedLogNormal.variance#
Variance of the zero-inflated distribution.
- ZeroInflatedLogNormal.zi_logits#
ZI logits.
- ZeroInflatedLogNormal.zi_probs#
ZI probabilities.