Poisson functions in the Stochastic DuckDB extension
Function category
Poisson
25 functionsPoisson — count of independent events in fixed interval at rate λ. Arrivals, defects, rare-event counts.
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
rate
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
x
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Computes the cumulative distribution function (CDF) of the Poisson distribution, P(X <= x).
SELECT dist_poisson_cdf(5.0, 3);
Output
| dist_poisson_cdf(5.0, 3) |
|---|
| 0.2650259152973617 |
Related functions
- dist_poisson_sample() — Generates a random sample from the Poisson distribution with the specified parameters
- dist_poisson_pdf() — Computes the probability mass function (PMF) of the Poisson distribution at x
- dist_poisson_quantile() — Computes the quantile function (inverse CDF) of the Poisson distribution
- dist_poisson_mean() — Returns the mean of the Poisson distribution
- dist_poisson_stddev() — Returns the standard deviation of the Poisson distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
rate
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
x
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Computes the complementary cumulative distribution function (survival function) of the Poisson distribution, P(X > x).
SELECT dist_poisson_cdf_complement(5.0, 3);
Output
| dist_poisson_cdf_complement(5.0, 3) |
|---|
| 0.7349740847026383 |
Related functions
- dist_poisson_sample() — Generates a random sample from the Poisson distribution with the specified parameters
- dist_poisson_pdf() — Computes the probability mass function (PMF) of the Poisson distribution at x
- dist_poisson_cdf() — Computes the cumulative distribution function (CDF) of the Poisson distribution, P(X <= x)
- dist_poisson_quantile() — Computes the quantile function (inverse CDF) of the Poisson distribution
- dist_poisson_mean() — Returns the mean of the Poisson distribution
- dist_poisson_stddev() — Returns the standard deviation of the Poisson distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
rate
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
x
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Computes the cumulative hazard function of the Poisson distribution at x.
SELECT dist_poisson_chf(5.0, 3);
Output
| dist_poisson_chf(5.0, 3) |
|---|
| 0.30792003929888545 |
Related functions
- dist_poisson_sample() — Generates a random sample from the Poisson distribution with the specified parameters
- dist_poisson_pdf() — Computes the probability mass function (PMF) of the Poisson distribution at x
- dist_poisson_cdf() — Computes the cumulative distribution function (CDF) of the Poisson distribution, P(X <= x)
- dist_poisson_quantile() — Computes the quantile function (inverse CDF) of the Poisson distribution
- dist_poisson_mean() — Returns the mean of the Poisson distribution
- dist_poisson_stddev() — Returns the standard deviation of the Poisson distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
x
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Fits a Poisson distribution to x by maximum likelihood. Returns a STRUCT with the fitted parameters (rate) followed by the log_likelihood, aic and bic of the fit, or NULL when there are too few or only identical values.
SELECT dist_poisson_fit(x).rate AS rate
FROM (VALUES (3), (5), (2), (4), (6), (4)) t(x);
Output
| rate |
|---|
| 4.0 |
Related functions
- dist_poisson_pdf() — Computes the probability mass function (PMF) of the Poisson distribution at x
- dist_poisson_cdf() — Computes the cumulative distribution function (CDF) of the Poisson distribution, P(X <= x)
- dist_poisson_sample() — Generates a random sample from the Poisson distribution with the specified parameters
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
rate
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
x
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Computes the hazard function of the Poisson distribution at x.
SELECT dist_poisson_hazard(5.0, 3);
Output
| dist_poisson_hazard(5.0, 3) |
|---|
| 0.1909916264205072 |
Related functions
- dist_poisson_sample() — Generates a random sample from the Poisson distribution with the specified parameters
- dist_poisson_pdf() — Computes the probability mass function (PMF) of the Poisson distribution at x
- dist_poisson_cdf() — Computes the cumulative distribution function (CDF) of the Poisson distribution, P(X <= x)
- dist_poisson_quantile() — Computes the quantile function (inverse CDF) of the Poisson distribution
- dist_poisson_mean() — Returns the mean of the Poisson distribution
- dist_poisson_stddev() — Returns the standard deviation of the Poisson distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
rate
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the kurtosis of the Poisson distribution. Returns NULL when it is undefined for the given parameters.
SELECT dist_poisson_kurtosis(5.0);
Output
| dist_poisson_kurtosis(5.0) |
|---|
| 3.2 |
Related functions
- dist_poisson_sample() — Generates a random sample from the Poisson distribution with the specified parameters
- dist_poisson_pdf() — Computes the probability mass function (PMF) of the Poisson distribution at x
- dist_poisson_cdf() — Computes the cumulative distribution function (CDF) of the Poisson distribution, P(X <= x)
- dist_poisson_quantile() — Computes the quantile function (inverse CDF) of the Poisson distribution
- dist_poisson_mean() — Returns the mean of the Poisson distribution
- dist_poisson_stddev() — Returns the standard deviation of the Poisson distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
rate
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the excess kurtosis of the Poisson distribution. Returns NULL when it is undefined for the given parameters.
SELECT dist_poisson_kurtosis_excess(5.0);
Output
| dist_poisson_kurtosis_excess(5.0) |
|---|
| 0.2 |
Related functions
- dist_poisson_sample() — Generates a random sample from the Poisson distribution with the specified parameters
- dist_poisson_pdf() — Computes the probability mass function (PMF) of the Poisson distribution at x
- dist_poisson_cdf() — Computes the cumulative distribution function (CDF) of the Poisson distribution, P(X <= x)
- dist_poisson_quantile() — Computes the quantile function (inverse CDF) of the Poisson distribution
- dist_poisson_mean() — Returns the mean of the Poisson distribution
- dist_poisson_stddev() — Returns the standard deviation of the Poisson distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
rate
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
x
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Computes the natural logarithm of the cumulative distribution function (CDF) of the Poisson distribution.
SELECT dist_poisson_log_cdf(5.0, 3);
Output
| dist_poisson_log_cdf(5.0, 3) |
|---|
| -1.327927664202445 |
Related functions
- dist_poisson_sample() — Generates a random sample from the Poisson distribution with the specified parameters
- dist_poisson_pdf() — Computes the probability mass function (PMF) of the Poisson distribution at x
- dist_poisson_cdf() — Computes the cumulative distribution function (CDF) of the Poisson distribution, P(X <= x)
- dist_poisson_quantile() — Computes the quantile function (inverse CDF) of the Poisson distribution
- dist_poisson_mean() — Returns the mean of the Poisson distribution
- dist_poisson_stddev() — Returns the standard deviation of the Poisson distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
rate
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
x
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Computes the natural logarithm of the survival function of the Poisson distribution, log P(X > x).
SELECT dist_poisson_log_cdf_complement(5.0, 3);
Output
| dist_poisson_log_cdf_complement(5.0, 3) |
|---|
| -0.30792003929888545 |
Related functions
- dist_poisson_sample() — Generates a random sample from the Poisson distribution with the specified parameters
- dist_poisson_pdf() — Computes the probability mass function (PMF) of the Poisson distribution at x
- dist_poisson_cdf() — Computes the cumulative distribution function (CDF) of the Poisson distribution, P(X <= x)
- dist_poisson_quantile() — Computes the quantile function (inverse CDF) of the Poisson distribution
- dist_poisson_mean() — Returns the mean of the Poisson distribution
- dist_poisson_stddev() — Returns the standard deviation of the Poisson distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
rate
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
x
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Computes the natural logarithm of the probability mass function (PMF) of the Poisson distribution at x. Useful for numerical stability when dealing with very small probabilities.
SELECT dist_poisson_log_pdf(5.0, 3);
Output
| dist_poisson_log_pdf(5.0, 3) |
|---|
| -1.963445731925754 |
Related functions
- dist_poisson_sample() — Generates a random sample from the Poisson distribution with the specified parameters
- dist_poisson_pdf() — Computes the probability mass function (PMF) of the Poisson distribution at x
- dist_poisson_cdf() — Computes the cumulative distribution function (CDF) of the Poisson distribution, P(X <= x)
- dist_poisson_quantile() — Computes the quantile function (inverse CDF) of the Poisson distribution
- dist_poisson_mean() — Returns the mean of the Poisson distribution
- dist_poisson_stddev() — Returns the standard deviation of the Poisson distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
rate
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
x
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Computes the natural logarithm of the probability mass function (PMF) of the Poisson distribution at x.
SELECT dist_poisson_log_pmf(5.0, 3);
Output
| dist_poisson_log_pmf(5.0, 3) |
|---|
| -1.963445731925754 |
Related functions
- dist_poisson_sample() — Generates a random sample from the Poisson distribution with the specified parameters
- dist_poisson_pdf() — Computes the probability mass function (PMF) of the Poisson distribution at x
- dist_poisson_quantile() — Computes the quantile function (inverse CDF) of the Poisson distribution
- dist_poisson_mean() — Returns the mean of the Poisson distribution
- dist_poisson_stddev() — Returns the standard deviation of the Poisson distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
rate
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the mean of the Poisson distribution. Returns NULL when it is undefined for the given parameters.
SELECT dist_poisson_mean(5.0);
Output
| dist_poisson_mean(5.0) |
|---|
| 5.0 |
Related functions
- dist_poisson_sample() — Generates a random sample from the Poisson distribution with the specified parameters
- dist_poisson_pdf() — Computes the probability mass function (PMF) of the Poisson distribution at x
- dist_poisson_cdf() — Computes the cumulative distribution function (CDF) of the Poisson distribution, P(X <= x)
- dist_poisson_quantile() — Computes the quantile function (inverse CDF) of the Poisson distribution
- dist_poisson_stddev() — Returns the standard deviation of the Poisson distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
rate
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the median of the Poisson distribution. Returns NULL when it is undefined for the given parameters.
SELECT dist_poisson_median(5.0);
Output
| dist_poisson_median(5.0) |
|---|
| 5.0 |
Related functions
- dist_poisson_sample() — Generates a random sample from the Poisson distribution with the specified parameters
- dist_poisson_pdf() — Computes the probability mass function (PMF) of the Poisson distribution at x
- dist_poisson_cdf() — Computes the cumulative distribution function (CDF) of the Poisson distribution, P(X <= x)
- dist_poisson_quantile() — Computes the quantile function (inverse CDF) of the Poisson distribution
- dist_poisson_mean() — Returns the mean of the Poisson distribution
- dist_poisson_stddev() — Returns the standard deviation of the Poisson distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
rate
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the mode (most likely value) of the Poisson distribution. Returns NULL when it is undefined for the given parameters.
SELECT dist_poisson_mode(5.0);
Output
| dist_poisson_mode(5.0) |
|---|
| 5.0 |
Related functions
- dist_poisson_sample() — Generates a random sample from the Poisson distribution with the specified parameters
- dist_poisson_pdf() — Computes the probability mass function (PMF) of the Poisson distribution at x
- dist_poisson_cdf() — Computes the cumulative distribution function (CDF) of the Poisson distribution, P(X <= x)
- dist_poisson_quantile() — Computes the quantile function (inverse CDF) of the Poisson distribution
- dist_poisson_mean() — Returns the mean of the Poisson distribution
- dist_poisson_stddev() — Returns the standard deviation of the Poisson distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
rate
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
x
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Computes the probability mass function (PMF) of the Poisson distribution at x.
SELECT dist_poisson_pdf(5.0, 3);
Output
| dist_poisson_pdf(5.0, 3) |
|---|
| 0.1403738958142805 |
Related functions
- dist_poisson_sample() — Generates a random sample from the Poisson distribution with the specified parameters
- dist_poisson_cdf() — Computes the cumulative distribution function (CDF) of the Poisson distribution, P(X <= x)
- dist_poisson_quantile() — Computes the quantile function (inverse CDF) of the Poisson distribution
- dist_poisson_mean() — Returns the mean of the Poisson distribution
- dist_poisson_stddev() — Returns the standard deviation of the Poisson distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
rate
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
x
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Computes the probability mass function (PMF) of the Poisson distribution at x, P(X = x).
SELECT round(dist_poisson_pmf(5.0, 3), 6) AS prob;
Output
| prob |
|---|
| 0.140374 |
Related functions
- dist_poisson_sample() — Generates a random sample from the Poisson distribution with the specified parameters
- dist_poisson_pdf() — Computes the probability mass function (PMF) of the Poisson distribution at x
- dist_poisson_quantile() — Computes the quantile function (inverse CDF) of the Poisson distribution
- dist_poisson_mean() — Returns the mean of the Poisson distribution
- dist_poisson_stddev() — Returns the standard deviation of the Poisson distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
rate
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
p
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Computes the quantile function (inverse CDF) of the Poisson distribution. Returns the smallest x such that P(X <= x) >= p.
SELECT dist_poisson_quantile(5.0, 0.3) AS q30, dist_poisson_quantile(5.0, 0.95) AS q95;
Output
| q30 | q95 |
|---|---|
| 4.0 | 9.0 |
Related functions
- dist_poisson_sample() — Generates a random sample from the Poisson distribution with the specified parameters
- dist_poisson_pdf() — Computes the probability mass function (PMF) of the Poisson distribution at x
- dist_poisson_cdf() — Computes the cumulative distribution function (CDF) of the Poisson distribution, P(X <= x)
- dist_poisson_mean() — Returns the mean of the Poisson distribution
- dist_poisson_stddev() — Returns the standard deviation of the Poisson distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
rate
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
p
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Computes the complementary quantile function of the Poisson distribution. Returns x such that P(X > x) = p, useful for upper tail quantiles.
SELECT dist_poisson_quantile_complement(5.0, 0.95);
Output
| dist_poisson_quantile_complement(5.0, 0.95) |
|---|
| 2.0 |
Related functions
- dist_poisson_sample() — Generates a random sample from the Poisson distribution with the specified parameters
- dist_poisson_pdf() — Computes the probability mass function (PMF) of the Poisson distribution at x
- dist_poisson_cdf() — Computes the cumulative distribution function (CDF) of the Poisson distribution, P(X <= x)
- dist_poisson_quantile() — Computes the quantile function (inverse CDF) of the Poisson distribution
- dist_poisson_mean() — Returns the mean of the Poisson distribution
- dist_poisson_stddev() — Returns the standard deviation of the Poisson distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
rate
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the range of the Poisson distribution as [min, max].
SELECT dist_poisson_range(5.0);
Output
| dist_poisson_range(5.0) |
|---|
| [0.0, inf] |
Related functions
- dist_poisson_sample() — Generates a random sample from the Poisson distribution with the specified parameters
- dist_poisson_pdf() — Computes the probability mass function (PMF) of the Poisson distribution at x
- dist_poisson_cdf() — Computes the cumulative distribution function (CDF) of the Poisson distribution, P(X <= x)
- dist_poisson_quantile() — Computes the quantile function (inverse CDF) of the Poisson distribution
- dist_poisson_mean() — Returns the mean of the Poisson distribution
- dist_poisson_stddev() — Returns the standard deviation of the Poisson distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
rate
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Generates a random sample from the Poisson distribution with the specified parameters.
SELECT dist_poisson_sample(5.0);
Output
| dist_poisson_sample(5.0) |
|---|
| 2 |
Related functions
- dist_poisson_pdf() — Computes the probability mass function (PMF) of the Poisson distribution at x
- dist_poisson_cdf() — Computes the cumulative distribution function (CDF) of the Poisson distribution, P(X <= x)
- dist_poisson_quantile() — Computes the quantile function (inverse CDF) of the Poisson distribution
- dist_poisson_mean() — Returns the mean of the Poisson distribution
- dist_poisson_stddev() — Returns the standard deviation of the Poisson distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
rate
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
n
|
Type
BIGINT
|
Mode Positional | Description |
Description
Generates a list of n random samples from the Poisson distribution with the specified parameters.
SELECT typeof(dist_poisson_samples(4.5, 3)) AS type;
Output
| type |
|---|
| BIGINT[] |
Related functions
- dist_poisson_sample() — Generates a random sample from the Poisson distribution with the specified parameters
- dist_poisson_pdf() — Computes the probability mass function (PMF) of the Poisson distribution at x
- dist_poisson_quantile() — Computes the quantile function (inverse CDF) of the Poisson distribution
- dist_poisson_mean() — Returns the mean of the Poisson distribution
- dist_poisson_stddev() — Returns the standard deviation of the Poisson distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
rate
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the skewness of the Poisson distribution. Returns NULL when it is undefined for the given parameters.
SELECT dist_poisson_skewness(5.0);
Output
| dist_poisson_skewness(5.0) |
|---|
| 0.4472135954999579 |
Related functions
- dist_poisson_sample() — Generates a random sample from the Poisson distribution with the specified parameters
- dist_poisson_pdf() — Computes the probability mass function (PMF) of the Poisson distribution at x
- dist_poisson_cdf() — Computes the cumulative distribution function (CDF) of the Poisson distribution, P(X <= x)
- dist_poisson_quantile() — Computes the quantile function (inverse CDF) of the Poisson distribution
- dist_poisson_mean() — Returns the mean of the Poisson distribution
- dist_poisson_stddev() — Returns the standard deviation of the Poisson distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
rate
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the standard deviation of the Poisson distribution. Returns NULL when it is undefined for the given parameters.
SELECT dist_poisson_stddev(5.0);
Output
| dist_poisson_stddev(5.0) |
|---|
| 2.23606797749979 |
Related functions
- dist_poisson_sample() — Generates a random sample from the Poisson distribution with the specified parameters
- dist_poisson_pdf() — Computes the probability mass function (PMF) of the Poisson distribution at x
- dist_poisson_cdf() — Computes the cumulative distribution function (CDF) of the Poisson distribution, P(X <= x)
- dist_poisson_quantile() — Computes the quantile function (inverse CDF) of the Poisson distribution
- dist_poisson_mean() — Returns the mean of the Poisson distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
rate
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the support of the Poisson distribution as [min, max].
SELECT dist_poisson_support(5.0);
Output
| dist_poisson_support(5.0) |
|---|
| [0.0, inf] |
Related functions
- dist_poisson_sample() — Generates a random sample from the Poisson distribution with the specified parameters
- dist_poisson_pdf() — Computes the probability mass function (PMF) of the Poisson distribution at x
- dist_poisson_cdf() — Computes the cumulative distribution function (CDF) of the Poisson distribution, P(X <= x)
- dist_poisson_quantile() — Computes the quantile function (inverse CDF) of the Poisson distribution
- dist_poisson_mean() — Returns the mean of the Poisson distribution
- dist_poisson_stddev() — Returns the standard deviation of the Poisson distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
rate
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the variance of the Poisson distribution. Returns NULL when it is undefined for the given parameters.
SELECT dist_poisson_variance(5.0);
Output
| dist_poisson_variance(5.0) |
|---|
| 5.0 |
Related functions
- dist_poisson_sample() — Generates a random sample from the Poisson distribution with the specified parameters
- dist_poisson_pdf() — Computes the probability mass function (PMF) of the Poisson distribution at x
- dist_poisson_cdf() — Computes the cumulative distribution function (CDF) of the Poisson distribution, P(X <= x)
- dist_poisson_quantile() — Computes the quantile function (inverse CDF) of the Poisson distribution
- dist_poisson_mean() — Returns the mean of the Poisson distribution
- dist_poisson_stddev() — Returns the standard deviation of the Poisson distribution