Gamma functions in the Stochastic DuckDB extension
Function category
Gamma
21 functionsGamma distribution — shape/scale family. Waiting times for k events at constant rate; flexible right-skewed prior.
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
alpha
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
beta
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
x
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Computes the cumulative distribution function (CDF) of the gamma distribution. Returns the probability that a random variable X is less than or equal to x.
SELECT dist_gamma_cdf(2.0, 1.0, 1.5);
Output
| dist_gamma_cdf(2.0, 1.0, 1.5) |
|---|
| 0.44217459962892547 |
Related functions
- dist_gamma_sample() — Generates random samples from the gamma distribution with specified parameters
- dist_gamma_pdf() — Computes the probability density function (PDF) of the gamma distribution
- dist_gamma_quantile() — Computes the quantile function (inverse CDF) of the gamma distribution
- dist_gamma_mean() — Returns the mean (μ) of the gamma distribution, which is the first moment
- dist_gamma_stddev() — Returns the standard deviation (σ) of the gamma distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
alpha
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
beta
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
x
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Computes the complementary cumulative distribution function (1 - CDF) of the gamma distribution. Returns the probability that X > x, equivalent to the survival function.
SELECT dist_gamma_cdf_complement(2.0, 1.0, 1.5);
Output
| dist_gamma_cdf_complement(2.0, 1.0, 1.5) |
|---|
| 0.5578254003710745 |
Related functions
- dist_gamma_sample() — Generates random samples from the gamma distribution with specified parameters
- dist_gamma_pdf() — Computes the probability density function (PDF) of the gamma distribution
- dist_gamma_cdf() — Computes the cumulative distribution function (CDF) of the gamma distribution
- dist_gamma_quantile() — Computes the quantile function (inverse CDF) of the gamma distribution
- dist_gamma_mean() — Returns the mean (μ) of the gamma distribution, which is the first moment
- dist_gamma_stddev() — Returns the standard deviation (σ) of the gamma distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
alpha
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
beta
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
x
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Computes the cumulative hazard function of the gamma distribution.
SELECT dist_gamma_chf(2.0, 1.0, 1.5);
Output
| dist_gamma_chf(2.0, 1.0, 1.5) |
|---|
| 0.583709268125845 |
Related functions
- dist_gamma_sample() — Generates random samples from the gamma distribution with specified parameters
- dist_gamma_pdf() — Computes the probability density function (PDF) of the gamma distribution
- dist_gamma_cdf() — Computes the cumulative distribution function (CDF) of the gamma distribution
- dist_gamma_quantile() — Computes the quantile function (inverse CDF) of the gamma distribution
- dist_gamma_mean() — Returns the mean (μ) of the gamma distribution, which is the first moment
- dist_gamma_stddev() — Returns the standard deviation (σ) of the gamma distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
alpha
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
beta
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
x
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Computes the hazard function of the gamma distribution.
SELECT dist_gamma_hazard(2.0, 1.0, 1.5);
Output
| dist_gamma_hazard(2.0, 1.0, 1.5) |
|---|
| 0.6 |
Related functions
- dist_gamma_sample() — Generates random samples from the gamma distribution with specified parameters
- dist_gamma_pdf() — Computes the probability density function (PDF) of the gamma distribution
- dist_gamma_cdf() — Computes the cumulative distribution function (CDF) of the gamma distribution
- dist_gamma_quantile() — Computes the quantile function (inverse CDF) of the gamma distribution
- dist_gamma_mean() — Returns the mean (μ) of the gamma distribution, which is the first moment
- dist_gamma_stddev() — Returns the standard deviation (σ) of the gamma distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
alpha
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
beta
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the kurtosis of the gamma distribution.
SELECT dist_gamma_kurtosis(2.0, 1.0);
Output
| dist_gamma_kurtosis(2.0, 1.0) |
|---|
| 6.0 |
Related functions
- dist_gamma_sample() — Generates random samples from the gamma distribution with specified parameters
- dist_gamma_pdf() — Computes the probability density function (PDF) of the gamma distribution
- dist_gamma_cdf() — Computes the cumulative distribution function (CDF) of the gamma distribution
- dist_gamma_quantile() — Computes the quantile function (inverse CDF) of the gamma distribution
- dist_gamma_mean() — Returns the mean (μ) of the gamma distribution, which is the first moment
- dist_gamma_stddev() — Returns the standard deviation (σ) of the gamma distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
alpha
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
beta
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the excess kurtosis of the gamma distribution.
SELECT dist_gamma_kurtosis_excess(2.0, 1.0);
Output
| dist_gamma_kurtosis_excess(2.0, 1.0) |
|---|
| 3.0 |
Related functions
- dist_gamma_sample() — Generates random samples from the gamma distribution with specified parameters
- dist_gamma_pdf() — Computes the probability density function (PDF) of the gamma distribution
- dist_gamma_cdf() — Computes the cumulative distribution function (CDF) of the gamma distribution
- dist_gamma_quantile() — Computes the quantile function (inverse CDF) of the gamma distribution
- dist_gamma_mean() — Returns the mean (μ) of the gamma distribution, which is the first moment
- dist_gamma_stddev() — Returns the standard deviation (σ) of the gamma distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
alpha
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
beta
|
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 gamma distribution. Returns the logarithm of the probability that a random variable X is less than or equal to x.
SELECT dist_gamma_log_cdf(2.0, 1.0, 1.5);
Output
| dist_gamma_log_cdf(2.0, 1.0, 1.5) |
|---|
| -0.8160504531201044 |
Related functions
- dist_gamma_sample() — Generates random samples from the gamma distribution with specified parameters
- dist_gamma_pdf() — Computes the probability density function (PDF) of the gamma distribution
- dist_gamma_cdf() — Computes the cumulative distribution function (CDF) of the gamma distribution
- dist_gamma_quantile() — Computes the quantile function (inverse CDF) of the gamma distribution
- dist_gamma_mean() — Returns the mean (μ) of the gamma distribution, which is the first moment
- dist_gamma_stddev() — Returns the standard deviation (σ) of the gamma distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
alpha
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
beta
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
x
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Computes the natural logarithm of the complementary cumulative distribution function (1 - CDF) of the gamma distribution. Returns the logarithm of the probability that X > x, equivalent to the survival function.
SELECT dist_gamma_log_cdf_complement(2.0, 1.0, 1.5);
Output
| dist_gamma_log_cdf_complement(2.0, 1.0, 1.5) |
|---|
| -0.583709268125845 |
Related functions
- dist_gamma_sample() — Generates random samples from the gamma distribution with specified parameters
- dist_gamma_pdf() — Computes the probability density function (PDF) of the gamma distribution
- dist_gamma_cdf() — Computes the cumulative distribution function (CDF) of the gamma distribution
- dist_gamma_quantile() — Computes the quantile function (inverse CDF) of the gamma distribution
- dist_gamma_mean() — Returns the mean (μ) of the gamma distribution, which is the first moment
- dist_gamma_stddev() — Returns the standard deviation (σ) of the gamma distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
alpha
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
beta
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
x
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Computes the natural logarithm of the probability density function (log-PDF) of the gamma distribution. Useful for numerical stability when dealing with very small probabilities.
SELECT dist_gamma_log_pdf(2.0, 1.0, 1.5);
Output
| dist_gamma_log_pdf(2.0, 1.0, 1.5) |
|---|
| -1.0945348918918356 |
Related functions
- dist_gamma_sample() — Generates random samples from the gamma distribution with specified parameters
- dist_gamma_pdf() — Computes the probability density function (PDF) of the gamma distribution
- dist_gamma_cdf() — Computes the cumulative distribution function (CDF) of the gamma distribution
- dist_gamma_quantile() — Computes the quantile function (inverse CDF) of the gamma distribution
- dist_gamma_mean() — Returns the mean (μ) of the gamma distribution, which is the first moment
- dist_gamma_stddev() — Returns the standard deviation (σ) of the gamma distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
alpha
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
beta
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the mean (μ) of the gamma distribution, which is the first moment.
SELECT dist_gamma_mean(2.0, 1.0);
Output
| dist_gamma_mean(2.0, 1.0) |
|---|
| 2.0 |
Related functions
- dist_gamma_sample() — Generates random samples from the gamma distribution with specified parameters
- dist_gamma_pdf() — Computes the probability density function (PDF) of the gamma distribution
- dist_gamma_cdf() — Computes the cumulative distribution function (CDF) of the gamma distribution
- dist_gamma_quantile() — Computes the quantile function (inverse CDF) of the gamma distribution
- dist_gamma_stddev() — Returns the standard deviation (σ) of the gamma distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
alpha
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
beta
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the median (50th percentile) of the gamma distribution, which equals the mean.
SELECT dist_gamma_median(2.0, 1.0);
Output
| dist_gamma_median(2.0, 1.0) |
|---|
| 1.6783469900166605 |
Related functions
- dist_gamma_sample() — Generates random samples from the gamma distribution with specified parameters
- dist_gamma_pdf() — Computes the probability density function (PDF) of the gamma distribution
- dist_gamma_cdf() — Computes the cumulative distribution function (CDF) of the gamma distribution
- dist_gamma_quantile() — Computes the quantile function (inverse CDF) of the gamma distribution
- dist_gamma_mean() — Returns the mean (μ) of the gamma distribution, which is the first moment
- dist_gamma_stddev() — Returns the standard deviation (σ) of the gamma distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
alpha
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
beta
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the mode (most likely value) of the gamma distribution, which equals the mean.
SELECT dist_gamma_mode(2.0, 1.0);
Output
| dist_gamma_mode(2.0, 1.0) |
|---|
| 1.0 |
Related functions
- dist_gamma_sample() — Generates random samples from the gamma distribution with specified parameters
- dist_gamma_pdf() — Computes the probability density function (PDF) of the gamma distribution
- dist_gamma_cdf() — Computes the cumulative distribution function (CDF) of the gamma distribution
- dist_gamma_quantile() — Computes the quantile function (inverse CDF) of the gamma distribution
- dist_gamma_mean() — Returns the mean (μ) of the gamma distribution, which is the first moment
- dist_gamma_stddev() — Returns the standard deviation (σ) of the gamma distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
alpha
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
beta
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
x
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Computes the probability density function (PDF) of the gamma distribution. Returns the probability densityat point x for a gamma distribution with specified parameters.
SELECT dist_gamma_pdf(2.0, 1.0, 1.5);
Output
| dist_gamma_pdf(2.0, 1.0, 1.5) |
|---|
| 0.3346952402226447 |
Related functions
- dist_gamma_sample() — Generates random samples from the gamma distribution with specified parameters
- dist_gamma_cdf() — Computes the cumulative distribution function (CDF) of the gamma distribution
- dist_gamma_quantile() — Computes the quantile function (inverse CDF) of the gamma distribution
- dist_gamma_mean() — Returns the mean (μ) of the gamma distribution, which is the first moment
- dist_gamma_stddev() — Returns the standard deviation (σ) of the gamma distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
alpha
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
beta
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
p
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Computes the quantile function (inverse CDF) of the gamma distribution. Returns the value x such that P(X ≤ x) = p, where p is the cumulative probability.
SELECT dist_gamma_quantile(2.0, 1.0, 0.95);
Output
| dist_gamma_quantile(2.0, 1.0, 0.95) |
|---|
| 4.743864518390577 |
Related functions
- dist_gamma_sample() — Generates random samples from the gamma distribution with specified parameters
- dist_gamma_pdf() — Computes the probability density function (PDF) of the gamma distribution
- dist_gamma_cdf() — Computes the cumulative distribution function (CDF) of the gamma distribution
- dist_gamma_mean() — Returns the mean (μ) of the gamma distribution, which is the first moment
- dist_gamma_stddev() — Returns the standard deviation (σ) of the gamma distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
alpha
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
beta
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
p
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Computes the complementary quantile function of the gamma distribution. Returns the value x such that P(X > x) = p, useful for computing upper tail quantiles.
SELECT dist_gamma_quantile_complement(2.0, 1.0, 0.05);
Output
| dist_gamma_quantile_complement(2.0, 1.0, 0.05) |
|---|
| 4.743864518390578 |
Related functions
- dist_gamma_sample() — Generates random samples from the gamma distribution with specified parameters
- dist_gamma_pdf() — Computes the probability density function (PDF) of the gamma distribution
- dist_gamma_cdf() — Computes the cumulative distribution function (CDF) of the gamma distribution
- dist_gamma_quantile() — Computes the quantile function (inverse CDF) of the gamma distribution
- dist_gamma_mean() — Returns the mean (μ) of the gamma distribution, which is the first moment
- dist_gamma_stddev() — Returns the standard deviation (σ) of the gamma distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
alpha
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
beta
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the range of the gamma distribution.
SELECT dist_gamma_range(2.0, 1.0);
Output
| dist_gamma_range(2.0, 1.0) |
|---|
| (0.0, 1.7976931348623157e+308) |
Related functions
- dist_gamma_sample() — Generates random samples from the gamma distribution with specified parameters
- dist_gamma_pdf() — Computes the probability density function (PDF) of the gamma distribution
- dist_gamma_cdf() — Computes the cumulative distribution function (CDF) of the gamma distribution
- dist_gamma_quantile() — Computes the quantile function (inverse CDF) of the gamma distribution
- dist_gamma_mean() — Returns the mean (μ) of the gamma distribution, which is the first moment
- dist_gamma_stddev() — Returns the standard deviation (σ) of the gamma distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
alpha
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
beta
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Generates random samples from the gamma distribution with specified parameters.
SELECT dist_gamma_sample(2.0, 1.0);
Output
| dist_gamma_sample(2.0, 1.0) |
|---|
| 1.036968725054842 |
Related functions
- dist_gamma_pdf() — Computes the probability density function (PDF) of the gamma distribution
- dist_gamma_cdf() — Computes the cumulative distribution function (CDF) of the gamma distribution
- dist_gamma_quantile() — Computes the quantile function (inverse CDF) of the gamma distribution
- dist_gamma_mean() — Returns the mean (μ) of the gamma distribution, which is the first moment
- dist_gamma_stddev() — Returns the standard deviation (σ) of the gamma distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
alpha
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
beta
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the skewness of the gamma distribution.
SELECT dist_gamma_skewness(2.0, 1.0);
Output
| dist_gamma_skewness(2.0, 1.0) |
|---|
| 1.414213562373095 |
Related functions
- dist_gamma_sample() — Generates random samples from the gamma distribution with specified parameters
- dist_gamma_pdf() — Computes the probability density function (PDF) of the gamma distribution
- dist_gamma_cdf() — Computes the cumulative distribution function (CDF) of the gamma distribution
- dist_gamma_quantile() — Computes the quantile function (inverse CDF) of the gamma distribution
- dist_gamma_mean() — Returns the mean (μ) of the gamma distribution, which is the first moment
- dist_gamma_stddev() — Returns the standard deviation (σ) of the gamma distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
alpha
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
beta
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the standard deviation (σ) of the gamma distribution.
SELECT dist_gamma_stddev(2.0, 1.0);
Output
| dist_gamma_stddev(2.0, 1.0) |
|---|
| 1.4142135623730951 |
Related functions
- dist_gamma_sample() — Generates random samples from the gamma distribution with specified parameters
- dist_gamma_pdf() — Computes the probability density function (PDF) of the gamma distribution
- dist_gamma_cdf() — Computes the cumulative distribution function (CDF) of the gamma distribution
- dist_gamma_quantile() — Computes the quantile function (inverse CDF) of the gamma distribution
- dist_gamma_mean() — Returns the mean (μ) of the gamma distribution, which is the first moment
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
alpha
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
beta
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the support of the gamma distribution.
SELECT dist_gamma_support(2.0, 1.0);
Output
| dist_gamma_support(2.0, 1.0) |
|---|
| (2.2250738585072014e-308, 1.7976931348623157e+308) |
Related functions
- dist_gamma_sample() — Generates random samples from the gamma distribution with specified parameters
- dist_gamma_pdf() — Computes the probability density function (PDF) of the gamma distribution
- dist_gamma_cdf() — Computes the cumulative distribution function (CDF) of the gamma distribution
- dist_gamma_quantile() — Computes the quantile function (inverse CDF) of the gamma distribution
- dist_gamma_mean() — Returns the mean (μ) of the gamma distribution, which is the first moment
- dist_gamma_stddev() — Returns the standard deviation (σ) of the gamma distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
alpha
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
beta
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the variance (σ²) of the gamma distribution.
SELECT dist_gamma_variance(2.0, 1.0);
Output
| dist_gamma_variance(2.0, 1.0) |
|---|
| 2.0 |
Related functions
- dist_gamma_sample() — Generates random samples from the gamma distribution with specified parameters
- dist_gamma_pdf() — Computes the probability density function (PDF) of the gamma distribution
- dist_gamma_cdf() — Computes the cumulative distribution function (CDF) of the gamma distribution
- dist_gamma_quantile() — Computes the quantile function (inverse CDF) of the gamma distribution
- dist_gamma_mean() — Returns the mean (μ) of the gamma distribution, which is the first moment
- dist_gamma_stddev() — Returns the standard deviation (σ) of the gamma distribution