# mx.symbol.random_pdf_generalized_negative_binomial¶

## Description¶

Computes the value of the PDF of sample of generalized negative binomial distributions with parameters mu (mean) and alpha (dispersion). This can be understood as a reparameterization of the negative binomial, where k = 1 / alpha and p = 1 / (mu * alpha + 1).

mu and alpha must have the same shape, which must match the leftmost subshape of sample. That is, sample can have the same shape as mu and alpha, in which case the output contains one density per distribution, or sample can be a tensor of tensors with that shape, in which case the output is a tensor of densities such that the densities at index i in the output are given by the samples at index i in sample parameterized by the values of mu and alpha at index i.

Example:

random_pdf_generalized_negative_binomial(sample=[[1, 2, 3, 4]], alpha=[1], mu=[1]) =
[[0.25, 0.125, 0.0625, 0.03125]]

sample = [[1,2,3,4],
[1,2,3,4]]
random_pdf_generalized_negative_binomial(sample=sample, alpha=[1, 0.6666], mu=[1, 1.5]) =
[[0.25,       0.125,      0.0625,     0.03125   ],
[0.26517063, 0.16573331, 0.09667706, 0.05437994]]


## Usage¶

mx.symbol.random_pdf_generalized_negative_binomial(...)


## Arguments¶

Argument

Description

sample

NDArray-or-Symbol.

Samples from the distributions.

mu

NDArray-or-Symbol.

Means of the distributions.

is.log

boolean, optional, default=0.

If set, compute the density of the log-probability instead of the probability.

alpha

NDArray-or-Symbol.

Alpha (dispersion) parameters of the distributions.

name

string, optional.

Name of the resulting symbol.

## Value¶

out The result mx.symbol