scvi.distributions.NegativeBinomial#
- class scvi.distributions.NegativeBinomial(total_count=None, probs=None, logits=None, mu=None, theta=None, scale=None, validate_args=False)[source]#
Bases:
DistributionNegative binomial distribution.
One of the following parameterizations must be provided:
(1), (
total_count,probs) wheretotal_countis the number of failures until the experiment is stopped andprobsthe success probability. (2), (mu,theta) parameterization, which is the one used by scvi-tools. These parameters respectively control the mean and inverse dispersion of the distribution.In the (
mu,theta) parameterization, samples from the negative binomial are generated as follows:\(w \sim \textrm{Gamma}(\underbrace{\theta}_{\text{shape}}, \underbrace{\theta/\mu}_{\text{rate}})\)
\(x \sim \textrm{Poisson}(w)\)
- Parameters:
- total_count
Tensor|None(default:None) Number of failures until the experiment is stopped.
- probs
Tensor|None(default:None) The success probability.
- mu
Tensor|None(default:None) Mean of the distribution.
- theta
Tensor|None(default:None) Inverse dispersion.
- scale
Tensor|None(default:None) Normalized mean expression of the distribution.
- validate_args
bool(default:False) Raise ValueError if arguments do not match constraints
- total_count
Attributes table#
Returns the mean of the distribution. |
|
Returns the variance of the distribution. |
Methods table#
|
|
|
Returns the log of the probability density/mass function evaluated at |
|
Sample from the distribution. |
Attributes#
- NegativeBinomial.arg_constraints = {'mu': Optional(GreaterThanEq(lower_bound=0)), 'scale': Optional(GreaterThanEq(lower_bound=0)), 'theta': Optional(GreaterThanEq(lower_bound=0))}#
- NegativeBinomial.mean#
- NegativeBinomial.support = IntegerGreaterThan(lower_bound=0)#
- NegativeBinomial.variance#