LostTech.TensorFlow : API Documentation

Namespace tensorflow.contrib.distributions

Parent Distribution

The `PoissonLogNormalQuadratureCompound` is an approximation to a Poisson-LogNormal [compound distribution]( https://en.wikipedia.org/wiki/Compound_probability_distribution), i.e.,

```none p(k|loc, scale) = int_{R_+} dl LogNormal(l | loc, scale) Poisson(k | l) approx= sum{ prob[d] Poisson(k | lambda(grid[d])) : d=0,..., deg-1 } ```

By default, the `grid` is chosen as quantiles of the `LogNormal` distribution parameterized by `loc`, `scale` and the `prob` vector is `[1. / quadrature_size]*quadrature_size`.

In the non-approximation case, a draw from the LogNormal prior represents the Poisson rate parameter. Unfortunately, the non-approximate distribution lacks an analytical probability density function (pdf). Therefore the `PoissonLogNormalQuadratureCompound` class implements an approximation based on [quadrature](https://en.wikipedia.org/wiki/Numerical_integration).

Note: although the `PoissonLogNormalQuadratureCompound` is approximately the Poisson-LogNormal compound distribution, it is itself a valid distribution. Viz., it possesses a `sample`, `log_prob`, `mean`, `variance`, etc. which are all mutually consistent.

#### Mathematical Details

The `PoissonLogNormalQuadratureCompound` approximates a Poisson-LogNormal [compound distribution]( https://en.wikipedia.org/wiki/Compound_probability_distribution). Using variable-substitution and [numerical quadrature]( https://en.wikipedia.org/wiki/Numerical_integration) (default: based on `LogNormal` quantiles) we can redefine the distribution to be a parameter-less convex combination of `deg` different Poisson samples.

That is, defined over positive integers, this distribution is parameterized by a (batch of) `loc` and `scale` scalars.

The probability density function (pdf) is,

```none pdf(k | loc, scale, deg) = sum{ prob[d] Poisson(k | lambda=exp(grid[d])) : d=0,..., deg-1 } ```

#### Examples

```python import tensorflow_probability as tfp tfd = tfp.distributions

# Create two batches of PoissonLogNormalQuadratureCompounds, one with # prior `loc = 0.` and another with `loc = 1.` In both cases `scale = 1.` pln = tfd.PoissonLogNormalQuadratureCompound( loc=[0., -0.5], scale=1., quadrature_size=10, validate_args=True)

Public properties

objectdistribution get;

Base Poisson parameterized by a quadrature grid.

objectdistribution_dyn get;

Base Poisson parameterized by a quadrature grid.

objectloc get;

Location parameter of the LogNormal prior.

objectloc_dyn get;

Location parameter of the LogNormal prior.

Categoricalmixture_distribution get;

Distribution which randomly selects a Poisson with quadrature param.

objectmixture_distribution_dyn get;

Distribution which randomly selects a Poisson with quadrature param.

objectscale get;

Scale parameter of the LogNormal prior.

objectscale_dyn get;

Scale parameter of the LogNormal prior.