Class

NumCosmoMathPLN1D

Description [src]

final class NumCosmoMath.PLN1D : GObject.Object
{
  /* No available fields */
}

A Poisson–Lognormal 1D integrator using mode finding (GSL Lambert-W), shifted Gauss–Hermite, or Laplace fallback.

Poisson–Lognormal 1D Distribution

Definitions

The Poisson component for an integer count R ≥ 0 and rate λ > 0 is $$ P_{\rm P}(R \mid \lambda) = e^{-\lambda} \frac{\lambda^{R}}{R!}. $$ The lognormal prior for λ is defined by $$ P_{\rm LN}(\lambda \mid \mu, \sigma) = \frac{1}{\lambda \, \sigma \sqrt{2\pi}} \exp!\left[-\frac{(\ln\lambda - \mu)^2}{2\sigma^2}\right], $$ where $\mu$ is the mean of $\log\lambda$ and $\sigma$ is the standard deviation of $\log\lambda$.

The Poisson–Lognormal likelihood is the integral $$ P(R \mid \mu,\sigma) = \int_{0}^{\infty} P_{\rm P}(R\mid\lambda)\, P_{\rm LN}(\lambda\mid\mu,\sigma)\; \mathrm{d}\lambda. $$

Change of Variables

We rewrite $\lambda$ using the substitution $$ \lambda = e^{\sigma x}, $$ where $x \in (-\infty,\infty)$ becomes the integration variable.

The Jacobian is $$ \mathrm{d}\lambda = \sigma\, e^{\sigma x}\, \mathrm{d}x. $$ Applying this change of variables and simplifying yields the integrand $$ I(x; R, \mu, \sigma) = -\frac{R^2\sigma^2}{2} + u R \sigma - \left(x - u\right)^2 - e^{\sigma x}, $$ where $u = \mu/\sigma + R\sigma$. Thus, $$ P(R\mid\mu,\sigma)= \int_{-\infty}^{\infty} \frac{\exp(I(x;R,\mu,\sigma))}{\sqrt{2\pi}\, R!}\, \mathrm{d}x. $$

Integrand Mode Finding

To find the mode of the integrand, we set the derivative of I with respect to x to zero: $$ \frac{\mathrm{d}}{\mathrm{d}x}I(x;R,\mu,\sigma) = 0. $$ Solving for x gives $$ x = u - \frac{W_0(\sigma^2 \exp(\sigma u))}{\sigma}, $$ Here, $W_0$ is the principal branch of the Lambert $W$ function.

Ancestors

Constructors

ncm_pln1d_new

Creates a new NcmPLN1D object.

Functions

ncm_pln1d_clear

Decrease the reference count of pln1d by one, and sets the pointer *pln1d to NULL.

ncm_pln1d_mode

Compute the mode of the Poisson–Lognormal integrand.

Instance methods

ncm_pln1d_eval_lnp

Evaluate the Poisson–Lognormal integral.

ncm_pln1d_eval_p

Evaluate the Poisson–Lognormal integral.

ncm_pln1d_eval_range_sum

Evaluate the cumulative Poisson–Lognormal probability by summing over a range of R values. This computes: ∑_{R=R_min}^{R_max} P(R|μ,σ).

ncm_pln1d_eval_range_sum_lnp

Evaluate the cumulative Poisson–Lognormal probability by summing over a range of R values. This computes: ∑_{R=R_min}^{R_max} P(R|μ,σ).

ncm_pln1d_free

Decrease the reference count of pln1d by one.

ncm_pln1d_get_order
No description available.

ncm_pln1d_ref

Increase the reference of pln1d by one.

ncm_pln1d_set_order
No description available.

Methods inherited from GObject (43)

Please see GObject for a full list of methods.

Properties

NumCosmoMath.PLN1D:gh-order

The Gauss-Hermite order to be used in the integration.

Signals

Signals inherited from GObject (1)
GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

Class structure

struct NumCosmoMathPLN1DClass {
  GObjectClass parent_class;
  
}

No description available.

Class members
parent_class: GObjectClass

No description available.