LostTech.TensorFlow : API Documentation

Type PoissonLogNormalQuadratureCompound

Namespace tensorflow.contrib.distributions

Parent Distribution

Interfaces IPoissonLogNormalQuadratureCompound

`PoissonLogNormalQuadratureCompound` 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)

Properties

Public properties

object allow_nan_stats get;

object allow_nan_stats_dyn get;

TensorShape batch_shape get;

object batch_shape_dyn get;

object distribution get;

Base Poisson parameterized by a quadrature grid.

object distribution_dyn get;

Base Poisson parameterized by a quadrature grid.

object dtype get;

object dtype_dyn get;

TensorShape event_shape get;

object event_shape_dyn get;

object loc get;

Location parameter of the LogNormal prior.

object loc_dyn get;

Location parameter of the LogNormal prior.

Categorical mixture_distribution get;

Distribution which randomly selects a Poisson with quadrature param.

object mixture_distribution_dyn get;

Distribution which randomly selects a Poisson with quadrature param.

string name get;

object name_dyn get;

IDictionary<object, object> parameters get;

object parameters_dyn get;

object PythonObject get;

int quadrature_size get;

object quadrature_size_dyn get;

object reparameterization_type get;

object reparameterization_type_dyn get;

object scale get;

Scale parameter of the LogNormal prior.

object scale_dyn get;

Scale parameter of the LogNormal prior.

object validate_args get;

object validate_args_dyn get;