Geometric functions in the Stochastic DuckDB extension
Function category
Geometric
21 functionsGeometric — number of failures before the first success in a Bernoulli trial sequence.
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
p
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
x
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Computes the cumulative distribution function (CDF) of the geometric distribution. Returns the probability that a random variable X is less than or equal to x.
SELECT dist_geometric_cdf(0.5, 2);
Output
| dist_geometric_cdf(0.5, 2) |
|---|
| 0.875 |
Related functions
- dist_geometric_sample() — Generates random samples from the geometric distribution with specified parameters
- dist_geometric_pdf() — Computes the probability density function (PDF) of the geometric distribution
- dist_geometric_quantile() — Computes the quantile function (inverse CDF) of the geometric distribution
- dist_geometric_mean() — Returns the mean (μ) of the geometric distribution, which is the first moment
- dist_geometric_stddev() — Returns the standard deviation (σ) of the geometric distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
p
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
x
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Computes the complementary cumulative distribution function (1 - CDF) of the geometric distribution. Returns the probability that X > x, equivalent to the survival function.
SELECT dist_geometric_cdf_complement(0.5, 2);
Output
| dist_geometric_cdf_complement(0.5, 2) |
|---|
| 0.12500000000000003 |
Related functions
- dist_geometric_sample() — Generates random samples from the geometric distribution with specified parameters
- dist_geometric_pdf() — Computes the probability density function (PDF) of the geometric distribution
- dist_geometric_cdf() — Computes the cumulative distribution function (CDF) of the geometric distribution
- dist_geometric_quantile() — Computes the quantile function (inverse CDF) of the geometric distribution
- dist_geometric_mean() — Returns the mean (μ) of the geometric distribution, which is the first moment
- dist_geometric_stddev() — Returns the standard deviation (σ) of the geometric distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
p
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
x
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Computes the cumulative hazard function of the geometric distribution.
SELECT dist_geometric_chf(0.5, 2);
Output
| dist_geometric_chf(0.5, 2) |
|---|
| 2.0794415416798357 |
Related functions
- dist_geometric_sample() — Generates random samples from the geometric distribution with specified parameters
- dist_geometric_pdf() — Computes the probability density function (PDF) of the geometric distribution
- dist_geometric_cdf() — Computes the cumulative distribution function (CDF) of the geometric distribution
- dist_geometric_quantile() — Computes the quantile function (inverse CDF) of the geometric distribution
- dist_geometric_mean() — Returns the mean (μ) of the geometric distribution, which is the first moment
- dist_geometric_stddev() — Returns the standard deviation (σ) of the geometric distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
p
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
x
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Computes the hazard function of the geometric distribution.
SELECT dist_geometric_hazard(0.5, 2);
Output
| dist_geometric_hazard(0.5, 2) |
|---|
| 0.9999999999999998 |
Related functions
- dist_geometric_sample() — Generates random samples from the geometric distribution with specified parameters
- dist_geometric_pdf() — Computes the probability density function (PDF) of the geometric distribution
- dist_geometric_cdf() — Computes the cumulative distribution function (CDF) of the geometric distribution
- dist_geometric_quantile() — Computes the quantile function (inverse CDF) of the geometric distribution
- dist_geometric_mean() — Returns the mean (μ) of the geometric distribution, which is the first moment
- dist_geometric_stddev() — Returns the standard deviation (σ) of the geometric distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
p
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the kurtosis of the geometric distribution.
SELECT dist_geometric_kurtosis(0.5);
Output
| dist_geometric_kurtosis(0.5) |
|---|
| 9.5 |
Related functions
- dist_geometric_sample() — Generates random samples from the geometric distribution with specified parameters
- dist_geometric_pdf() — Computes the probability density function (PDF) of the geometric distribution
- dist_geometric_cdf() — Computes the cumulative distribution function (CDF) of the geometric distribution
- dist_geometric_quantile() — Computes the quantile function (inverse CDF) of the geometric distribution
- dist_geometric_mean() — Returns the mean (μ) of the geometric distribution, which is the first moment
- dist_geometric_stddev() — Returns the standard deviation (σ) of the geometric distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
p
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the excess kurtosis of the geometric distribution.
SELECT dist_geometric_kurtosis_excess(0.5);
Output
| dist_geometric_kurtosis_excess(0.5) |
|---|
| 6.5 |
Related functions
- dist_geometric_sample() — Generates random samples from the geometric distribution with specified parameters
- dist_geometric_pdf() — Computes the probability density function (PDF) of the geometric distribution
- dist_geometric_cdf() — Computes the cumulative distribution function (CDF) of the geometric distribution
- dist_geometric_quantile() — Computes the quantile function (inverse CDF) of the geometric distribution
- dist_geometric_mean() — Returns the mean (μ) of the geometric distribution, which is the first moment
- dist_geometric_stddev() — Returns the standard deviation (σ) of the geometric distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
p
|
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 geometric distribution. Returns the logarithm of the probability that a random variable X is less than or equal to x.
SELECT dist_geometric_log_cdf(0.5, 2);
Output
| dist_geometric_log_cdf(0.5, 2) |
|---|
| -0.13353139262452265 |
Related functions
- dist_geometric_sample() — Generates random samples from the geometric distribution with specified parameters
- dist_geometric_pdf() — Computes the probability density function (PDF) of the geometric distribution
- dist_geometric_cdf() — Computes the cumulative distribution function (CDF) of the geometric distribution
- dist_geometric_quantile() — Computes the quantile function (inverse CDF) of the geometric distribution
- dist_geometric_mean() — Returns the mean (μ) of the geometric distribution, which is the first moment
- dist_geometric_stddev() — Returns the standard deviation (σ) of the geometric distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
p
|
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 geometric distribution. Returns the logarithm of the probability that X > x, equivalent to the survival function.
SELECT dist_geometric_log_cdf_complement(0.5, 2);
Output
| dist_geometric_log_cdf_complement(0.5, 2) |
|---|
| -2.0794415416798357 |
Related functions
- dist_geometric_sample() — Generates random samples from the geometric distribution with specified parameters
- dist_geometric_pdf() — Computes the probability density function (PDF) of the geometric distribution
- dist_geometric_cdf() — Computes the cumulative distribution function (CDF) of the geometric distribution
- dist_geometric_quantile() — Computes the quantile function (inverse CDF) of the geometric distribution
- dist_geometric_mean() — Returns the mean (μ) of the geometric distribution, which is the first moment
- dist_geometric_stddev() — Returns the standard deviation (σ) of the geometric distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
p
|
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 geometric distribution. Useful for numerical stability when dealing with very small probabilities.
SELECT dist_geometric_log_pdf(0.5, 2);
Output
| dist_geometric_log_pdf(0.5, 2) |
|---|
| -2.0794415416798357 |
Related functions
- dist_geometric_sample() — Generates random samples from the geometric distribution with specified parameters
- dist_geometric_pdf() — Computes the probability density function (PDF) of the geometric distribution
- dist_geometric_cdf() — Computes the cumulative distribution function (CDF) of the geometric distribution
- dist_geometric_quantile() — Computes the quantile function (inverse CDF) of the geometric distribution
- dist_geometric_mean() — Returns the mean (μ) of the geometric distribution, which is the first moment
- dist_geometric_stddev() — Returns the standard deviation (σ) of the geometric distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
p
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the mean (μ) of the geometric distribution, which is the first moment.
SELECT dist_geometric_mean(0.5);
Output
| dist_geometric_mean(0.5) |
|---|
| 1.0 |
Related functions
- dist_geometric_sample() — Generates random samples from the geometric distribution with specified parameters
- dist_geometric_pdf() — Computes the probability density function (PDF) of the geometric distribution
- dist_geometric_cdf() — Computes the cumulative distribution function (CDF) of the geometric distribution
- dist_geometric_quantile() — Computes the quantile function (inverse CDF) of the geometric distribution
- dist_geometric_stddev() — Returns the standard deviation (σ) of the geometric distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
p
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the median (50th percentile) of the geometric distribution, which equals the mean.
SELECT dist_geometric_median(0.5);
Output
| dist_geometric_median(0.5) |
|---|
| 0.0 |
Related functions
- dist_geometric_sample() — Generates random samples from the geometric distribution with specified parameters
- dist_geometric_pdf() — Computes the probability density function (PDF) of the geometric distribution
- dist_geometric_cdf() — Computes the cumulative distribution function (CDF) of the geometric distribution
- dist_geometric_quantile() — Computes the quantile function (inverse CDF) of the geometric distribution
- dist_geometric_mean() — Returns the mean (μ) of the geometric distribution, which is the first moment
- dist_geometric_stddev() — Returns the standard deviation (σ) of the geometric distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
p
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the mode (most likely value) of the geometric distribution, which equals the mean.
SELECT dist_geometric_mode(0.5);
Output
| dist_geometric_mode(0.5) |
|---|
| 0.0 |
Related functions
- dist_geometric_sample() — Generates random samples from the geometric distribution with specified parameters
- dist_geometric_pdf() — Computes the probability density function (PDF) of the geometric distribution
- dist_geometric_cdf() — Computes the cumulative distribution function (CDF) of the geometric distribution
- dist_geometric_quantile() — Computes the quantile function (inverse CDF) of the geometric distribution
- dist_geometric_mean() — Returns the mean (μ) of the geometric distribution, which is the first moment
- dist_geometric_stddev() — Returns the standard deviation (σ) of the geometric distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
p
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
x
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Computes the probability density function (PDF) of the geometric distribution. Returns the probability densityat point x for a geometric distribution with specified parameters.
SELECT dist_geometric_pdf(0.5, 2);
Output
| dist_geometric_pdf(0.5, 2) |
|---|
| 0.125 |
Related functions
- dist_geometric_sample() — Generates random samples from the geometric distribution with specified parameters
- dist_geometric_cdf() — Computes the cumulative distribution function (CDF) of the geometric distribution
- dist_geometric_quantile() — Computes the quantile function (inverse CDF) of the geometric distribution
- dist_geometric_mean() — Returns the mean (μ) of the geometric distribution, which is the first moment
- dist_geometric_stddev() — Returns the standard deviation (σ) of the geometric distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
p
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
p
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Computes the quantile function (inverse CDF) of the geometric distribution. Returns the value x such that P(X ≤ x) = p, where p is the cumulative probability.
SELECT dist_geometric_quantile(0.5, 0.95);
Output
| dist_geometric_quantile(0.5, 0.95) |
|---|
| 3.321928094887361 |
Related functions
- dist_geometric_sample() — Generates random samples from the geometric distribution with specified parameters
- dist_geometric_pdf() — Computes the probability density function (PDF) of the geometric distribution
- dist_geometric_cdf() — Computes the cumulative distribution function (CDF) of the geometric distribution
- dist_geometric_mean() — Returns the mean (μ) of the geometric distribution, which is the first moment
- dist_geometric_stddev() — Returns the standard deviation (σ) of the geometric distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
p
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
p
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Computes the complementary quantile function of the geometric distribution. Returns the value x such that P(X > x) = p, useful for computing upper tail quantiles.
SELECT dist_geometric_quantile_complement(0.5, 0.05);
Output
| dist_geometric_quantile_complement(0.5, 0.05) |
|---|
| 3.3219280948873626 |
Related functions
- dist_geometric_sample() — Generates random samples from the geometric distribution with specified parameters
- dist_geometric_pdf() — Computes the probability density function (PDF) of the geometric distribution
- dist_geometric_cdf() — Computes the cumulative distribution function (CDF) of the geometric distribution
- dist_geometric_quantile() — Computes the quantile function (inverse CDF) of the geometric distribution
- dist_geometric_mean() — Returns the mean (μ) of the geometric distribution, which is the first moment
- dist_geometric_stddev() — Returns the standard deviation (σ) of the geometric distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
p
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the range of the geometric distribution.
SELECT dist_geometric_range(0.5);
Output
| dist_geometric_range(0.5) |
|---|
| (0.0, 1.7976931348623157e+308) |
Related functions
- dist_geometric_sample() — Generates random samples from the geometric distribution with specified parameters
- dist_geometric_pdf() — Computes the probability density function (PDF) of the geometric distribution
- dist_geometric_cdf() — Computes the cumulative distribution function (CDF) of the geometric distribution
- dist_geometric_quantile() — Computes the quantile function (inverse CDF) of the geometric distribution
- dist_geometric_mean() — Returns the mean (μ) of the geometric distribution, which is the first moment
- dist_geometric_stddev() — Returns the standard deviation (σ) of the geometric distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
p
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Generates random samples from the geometric distribution with specified parameters.
SELECT dist_geometric_sample(0.5);
Output
| dist_geometric_sample(0.5) |
|---|
| 3 |
Related functions
- dist_geometric_pdf() — Computes the probability density function (PDF) of the geometric distribution
- dist_geometric_cdf() — Computes the cumulative distribution function (CDF) of the geometric distribution
- dist_geometric_quantile() — Computes the quantile function (inverse CDF) of the geometric distribution
- dist_geometric_mean() — Returns the mean (μ) of the geometric distribution, which is the first moment
- dist_geometric_stddev() — Returns the standard deviation (σ) of the geometric distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
p
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the skewness of the geometric distribution.
SELECT dist_geometric_skewness(0.5);
Output
| dist_geometric_skewness(0.5) |
|---|
| 2.1213203435596424 |
Related functions
- dist_geometric_sample() — Generates random samples from the geometric distribution with specified parameters
- dist_geometric_pdf() — Computes the probability density function (PDF) of the geometric distribution
- dist_geometric_cdf() — Computes the cumulative distribution function (CDF) of the geometric distribution
- dist_geometric_quantile() — Computes the quantile function (inverse CDF) of the geometric distribution
- dist_geometric_mean() — Returns the mean (μ) of the geometric distribution, which is the first moment
- dist_geometric_stddev() — Returns the standard deviation (σ) of the geometric distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
p
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the standard deviation (σ) of the geometric distribution.
SELECT dist_geometric_stddev(0.5);
Output
| dist_geometric_stddev(0.5) |
|---|
| 1.4142135623730951 |
Related functions
- dist_geometric_sample() — Generates random samples from the geometric distribution with specified parameters
- dist_geometric_pdf() — Computes the probability density function (PDF) of the geometric distribution
- dist_geometric_cdf() — Computes the cumulative distribution function (CDF) of the geometric distribution
- dist_geometric_quantile() — Computes the quantile function (inverse CDF) of the geometric distribution
- dist_geometric_mean() — Returns the mean (μ) of the geometric distribution, which is the first moment
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
p
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the support of the geometric distribution.
SELECT dist_geometric_support(0.5);
Output
| dist_geometric_support(0.5) |
|---|
| (0.0, 1.7976931348623157e+308) |
Related functions
- dist_geometric_sample() — Generates random samples from the geometric distribution with specified parameters
- dist_geometric_pdf() — Computes the probability density function (PDF) of the geometric distribution
- dist_geometric_cdf() — Computes the cumulative distribution function (CDF) of the geometric distribution
- dist_geometric_quantile() — Computes the quantile function (inverse CDF) of the geometric distribution
- dist_geometric_mean() — Returns the mean (μ) of the geometric distribution, which is the first moment
- dist_geometric_stddev() — Returns the standard deviation (σ) of the geometric distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
p
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the variance (σ²) of the geometric distribution.
SELECT dist_geometric_variance(0.5);
Output
| dist_geometric_variance(0.5) |
|---|
| 2.0 |
Related functions
- dist_geometric_sample() — Generates random samples from the geometric distribution with specified parameters
- dist_geometric_pdf() — Computes the probability density function (PDF) of the geometric distribution
- dist_geometric_cdf() — Computes the cumulative distribution function (CDF) of the geometric distribution
- dist_geometric_quantile() — Computes the quantile function (inverse CDF) of the geometric distribution
- dist_geometric_mean() — Returns the mean (μ) of the geometric distribution, which is the first moment
- dist_geometric_stddev() — Returns the standard deviation (σ) of the geometric distribution