Exponential functions in the Stochastic DuckDB extension
Function category
Exponential
24 functionsExponential distribution — memoryless waiting time between events at rate λ. Survival analysis and reliability.
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 exponential distribution, P(X <= x).
SELECT dist_exponential_cdf(1.0, 0.5);
Output
| dist_exponential_cdf(1.0, 0.5) |
|---|
| 0.3934693402873666 |
Related functions
- dist_exponential_sample() — Generates a random sample from the exponential distribution with the specified parameters
- dist_exponential_pdf() — Computes the probability density function (PDF) of the exponential distribution at x
- dist_exponential_quantile() — Computes the quantile function (inverse CDF) of the exponential distribution
- dist_exponential_mean() — Returns the mean of the exponential distribution
- dist_exponential_stddev() — Returns the standard deviation of the exponential 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 exponential distribution, P(X > x).
SELECT dist_exponential_cdf_complement(1.0, 0.5);
Output
| dist_exponential_cdf_complement(1.0, 0.5) |
|---|
| 0.6065306597126334 |
Related functions
- dist_exponential_sample() — Generates a random sample from the exponential distribution with the specified parameters
- dist_exponential_pdf() — Computes the probability density function (PDF) of the exponential distribution at x
- dist_exponential_cdf() — Computes the cumulative distribution function (CDF) of the exponential distribution, P(X <= x)
- dist_exponential_quantile() — Computes the quantile function (inverse CDF) of the exponential distribution
- dist_exponential_mean() — Returns the mean of the exponential distribution
- dist_exponential_stddev() — Returns the standard deviation of the exponential 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 exponential distribution at x.
SELECT dist_exponential_chf(1.0, 0.5);
Output
| dist_exponential_chf(1.0, 0.5) |
|---|
| 0.5 |
Related functions
- dist_exponential_sample() — Generates a random sample from the exponential distribution with the specified parameters
- dist_exponential_pdf() — Computes the probability density function (PDF) of the exponential distribution at x
- dist_exponential_cdf() — Computes the cumulative distribution function (CDF) of the exponential distribution, P(X <= x)
- dist_exponential_quantile() — Computes the quantile function (inverse CDF) of the exponential distribution
- dist_exponential_mean() — Returns the mean of the exponential distribution
- dist_exponential_stddev() — Returns the standard deviation of the exponential distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
x
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Fits a exponential 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 round(dist_exponential_fit(x).rate, 6) AS rate
FROM (VALUES (0.5), (1.2), (0.3), (2.0)) t(x);
Output
| rate |
|---|
| 1.0 |
Related functions
- dist_exponential_ks_test() — One-sample Kolmogorov-Smirnov test of whether x follows the exponential distribution with the given parameters
- dist_exponential_pdf() — Computes the probability density function (PDF) of the exponential distribution at x
- dist_exponential_cdf() — Computes the cumulative distribution function (CDF) of the exponential distribution, P(X <= x)
- dist_exponential_sample() — Generates a random sample from the exponential 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 exponential distribution at x.
SELECT dist_exponential_hazard(1.0, 0.5);
Output
| dist_exponential_hazard(1.0, 0.5) |
|---|
| 1.0 |
Related functions
- dist_exponential_sample() — Generates a random sample from the exponential distribution with the specified parameters
- dist_exponential_pdf() — Computes the probability density function (PDF) of the exponential distribution at x
- dist_exponential_cdf() — Computes the cumulative distribution function (CDF) of the exponential distribution, P(X <= x)
- dist_exponential_quantile() — Computes the quantile function (inverse CDF) of the exponential distribution
- dist_exponential_mean() — Returns the mean of the exponential distribution
- dist_exponential_stddev() — Returns the standard deviation of the exponential distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
x
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
rate
|
Type
DOUBLE
|
Mode Positional | Description |
Description
One-sample Kolmogorov-Smirnov test of whether x follows the exponential distribution with the given parameters. Returns the statistic D and the asymptotic p-value.
SELECT round(dist_exponential_ks_test(x, 2.0).p_value, 4) AS p_value
FROM (VALUES (0.1), (0.6), (0.3), (0.05), (1.2), (0.4), (0.2), (0.9)) t(x);
Output
| p_value |
|---|
| 1.0 |
Related functions
- dist_exponential_fit() — Fits a exponential distribution to x by maximum likelihood
- dist_exponential_cdf() — Computes the cumulative distribution function (CDF) of the exponential distribution, P(X <= x)
- dist_exponential_sample() — Generates a random sample from the exponential distribution with the specified parameters
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
rate
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the kurtosis of the exponential distribution. Returns NULL when it is undefined for the given parameters.
SELECT dist_exponential_kurtosis(1.0);
Output
| dist_exponential_kurtosis(1.0) |
|---|
| 9.0 |
Related functions
- dist_exponential_sample() — Generates a random sample from the exponential distribution with the specified parameters
- dist_exponential_pdf() — Computes the probability density function (PDF) of the exponential distribution at x
- dist_exponential_cdf() — Computes the cumulative distribution function (CDF) of the exponential distribution, P(X <= x)
- dist_exponential_quantile() — Computes the quantile function (inverse CDF) of the exponential distribution
- dist_exponential_mean() — Returns the mean of the exponential distribution
- dist_exponential_stddev() — Returns the standard deviation of the exponential distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
rate
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the excess kurtosis of the exponential distribution. Returns NULL when it is undefined for the given parameters.
SELECT dist_exponential_kurtosis_excess(1.0);
Output
| dist_exponential_kurtosis_excess(1.0) |
|---|
| 6.0 |
Related functions
- dist_exponential_sample() — Generates a random sample from the exponential distribution with the specified parameters
- dist_exponential_pdf() — Computes the probability density function (PDF) of the exponential distribution at x
- dist_exponential_cdf() — Computes the cumulative distribution function (CDF) of the exponential distribution, P(X <= x)
- dist_exponential_quantile() — Computes the quantile function (inverse CDF) of the exponential distribution
- dist_exponential_mean() — Returns the mean of the exponential distribution
- dist_exponential_stddev() — Returns the standard deviation of the exponential 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 exponential distribution.
SELECT dist_exponential_log_cdf(1.0, 0.5);
Output
| dist_exponential_log_cdf(1.0, 0.5) |
|---|
| -0.9327521295671886 |
Related functions
- dist_exponential_sample() — Generates a random sample from the exponential distribution with the specified parameters
- dist_exponential_pdf() — Computes the probability density function (PDF) of the exponential distribution at x
- dist_exponential_cdf() — Computes the cumulative distribution function (CDF) of the exponential distribution, P(X <= x)
- dist_exponential_quantile() — Computes the quantile function (inverse CDF) of the exponential distribution
- dist_exponential_mean() — Returns the mean of the exponential distribution
- dist_exponential_stddev() — Returns the standard deviation of the exponential 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 exponential distribution, log P(X > x).
SELECT dist_exponential_log_cdf_complement(1.0, 0.5);
Output
| dist_exponential_log_cdf_complement(1.0, 0.5) |
|---|
| -0.5 |
Related functions
- dist_exponential_sample() — Generates a random sample from the exponential distribution with the specified parameters
- dist_exponential_pdf() — Computes the probability density function (PDF) of the exponential distribution at x
- dist_exponential_cdf() — Computes the cumulative distribution function (CDF) of the exponential distribution, P(X <= x)
- dist_exponential_quantile() — Computes the quantile function (inverse CDF) of the exponential distribution
- dist_exponential_mean() — Returns the mean of the exponential distribution
- dist_exponential_stddev() — Returns the standard deviation of the exponential 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 density function (PDF) of the exponential distribution at x. Useful for numerical stability when dealing with very small probabilities.
SELECT dist_exponential_log_pdf(1.0, 0.5);
Output
| dist_exponential_log_pdf(1.0, 0.5) |
|---|
| -0.5 |
Related functions
- dist_exponential_sample() — Generates a random sample from the exponential distribution with the specified parameters
- dist_exponential_pdf() — Computes the probability density function (PDF) of the exponential distribution at x
- dist_exponential_cdf() — Computes the cumulative distribution function (CDF) of the exponential distribution, P(X <= x)
- dist_exponential_quantile() — Computes the quantile function (inverse CDF) of the exponential distribution
- dist_exponential_mean() — Returns the mean of the exponential distribution
- dist_exponential_stddev() — Returns the standard deviation of the exponential distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
rate
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the mean of the exponential distribution. Returns NULL when it is undefined for the given parameters.
SELECT dist_exponential_mean(1.0);
Output
| dist_exponential_mean(1.0) |
|---|
| 1.0 |
Related functions
- dist_exponential_sample() — Generates a random sample from the exponential distribution with the specified parameters
- dist_exponential_pdf() — Computes the probability density function (PDF) of the exponential distribution at x
- dist_exponential_cdf() — Computes the cumulative distribution function (CDF) of the exponential distribution, P(X <= x)
- dist_exponential_quantile() — Computes the quantile function (inverse CDF) of the exponential distribution
- dist_exponential_stddev() — Returns the standard deviation of the exponential distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
rate
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the median of the exponential distribution. Returns NULL when it is undefined for the given parameters.
SELECT dist_exponential_median(1.0);
Output
| dist_exponential_median(1.0) |
|---|
| 0.6931471805599453 |
Related functions
- dist_exponential_sample() — Generates a random sample from the exponential distribution with the specified parameters
- dist_exponential_pdf() — Computes the probability density function (PDF) of the exponential distribution at x
- dist_exponential_cdf() — Computes the cumulative distribution function (CDF) of the exponential distribution, P(X <= x)
- dist_exponential_quantile() — Computes the quantile function (inverse CDF) of the exponential distribution
- dist_exponential_mean() — Returns the mean of the exponential distribution
- dist_exponential_stddev() — Returns the standard deviation of the exponential distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
rate
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the mode (most likely value) of the exponential distribution. Returns NULL when it is undefined for the given parameters.
SELECT dist_exponential_mode(1.0);
Output
| dist_exponential_mode(1.0) |
|---|
| 0.0 |
Related functions
- dist_exponential_sample() — Generates a random sample from the exponential distribution with the specified parameters
- dist_exponential_pdf() — Computes the probability density function (PDF) of the exponential distribution at x
- dist_exponential_cdf() — Computes the cumulative distribution function (CDF) of the exponential distribution, P(X <= x)
- dist_exponential_quantile() — Computes the quantile function (inverse CDF) of the exponential distribution
- dist_exponential_mean() — Returns the mean of the exponential distribution
- dist_exponential_stddev() — Returns the standard deviation of the exponential 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 density function (PDF) of the exponential distribution at x.
SELECT dist_exponential_pdf(1.0, 0.5);
Output
| dist_exponential_pdf(1.0, 0.5) |
|---|
| 0.6065306597126334 |
Related functions
- dist_exponential_sample() — Generates a random sample from the exponential distribution with the specified parameters
- dist_exponential_cdf() — Computes the cumulative distribution function (CDF) of the exponential distribution, P(X <= x)
- dist_exponential_quantile() — Computes the quantile function (inverse CDF) of the exponential distribution
- dist_exponential_mean() — Returns the mean of the exponential distribution
- dist_exponential_stddev() — Returns the standard deviation of the exponential 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 exponential distribution. Returns the smallest x such that P(X <= x) >= p.
SELECT dist_exponential_quantile(1.0, 0.95);
Output
| dist_exponential_quantile(1.0, 0.95) |
|---|
| 2.99573227355399 |
Related functions
- dist_exponential_sample() — Generates a random sample from the exponential distribution with the specified parameters
- dist_exponential_pdf() — Computes the probability density function (PDF) of the exponential distribution at x
- dist_exponential_cdf() — Computes the cumulative distribution function (CDF) of the exponential distribution, P(X <= x)
- dist_exponential_mean() — Returns the mean of the exponential distribution
- dist_exponential_stddev() — Returns the standard deviation of the exponential 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 exponential distribution. Returns x such that P(X > x) = p, useful for upper tail quantiles.
SELECT dist_exponential_quantile_complement(1.0, 0.95);
Output
| dist_exponential_quantile_complement(1.0, 0.95) |
|---|
| 0.05129329438755058 |
Related functions
- dist_exponential_sample() — Generates a random sample from the exponential distribution with the specified parameters
- dist_exponential_pdf() — Computes the probability density function (PDF) of the exponential distribution at x
- dist_exponential_cdf() — Computes the cumulative distribution function (CDF) of the exponential distribution, P(X <= x)
- dist_exponential_quantile() — Computes the quantile function (inverse CDF) of the exponential distribution
- dist_exponential_mean() — Returns the mean of the exponential distribution
- dist_exponential_stddev() — Returns the standard deviation of the exponential distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
rate
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the range of the exponential distribution as [min, max].
SELECT dist_exponential_range(1.0);
Output
| dist_exponential_range(1.0) |
|---|
| [0.0, inf] |
Related functions
- dist_exponential_sample() — Generates a random sample from the exponential distribution with the specified parameters
- dist_exponential_pdf() — Computes the probability density function (PDF) of the exponential distribution at x
- dist_exponential_cdf() — Computes the cumulative distribution function (CDF) of the exponential distribution, P(X <= x)
- dist_exponential_quantile() — Computes the quantile function (inverse CDF) of the exponential distribution
- dist_exponential_mean() — Returns the mean of the exponential distribution
- dist_exponential_stddev() — Returns the standard deviation of the exponential distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
rate
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Generates a random sample from the exponential distribution with the specified parameters.
SELECT dist_exponential_sample(1.0);
Output
| dist_exponential_sample(1.0) |
|---|
| 4.468303879664344 |
Related functions
- dist_exponential_pdf() — Computes the probability density function (PDF) of the exponential distribution at x
- dist_exponential_cdf() — Computes the cumulative distribution function (CDF) of the exponential distribution, P(X <= x)
- dist_exponential_quantile() — Computes the quantile function (inverse CDF) of the exponential distribution
- dist_exponential_mean() — Returns the mean of the exponential distribution
- dist_exponential_stddev() — Returns the standard deviation of the exponential 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 exponential distribution with the specified parameters.
SELECT dist_exponential_samples(1.0, 5);
Output
| dist_exponential_samples(1.0, 5) |
|---|
| [2.472001441687162, 0.38207212595026135, 1.0272636474133852, 0.816043389506743, 0.8181557290960337] |
Related functions
- dist_exponential_sample() — Generates a random sample from the exponential distribution with the specified parameters
- dist_exponential_pdf() — Computes the probability density function (PDF) of the exponential distribution at x
- dist_exponential_quantile() — Computes the quantile function (inverse CDF) of the exponential distribution
- dist_exponential_mean() — Returns the mean of the exponential distribution
- dist_exponential_stddev() — Returns the standard deviation of the exponential distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
rate
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the skewness of the exponential distribution. Returns NULL when it is undefined for the given parameters.
SELECT dist_exponential_skewness(1.0);
Output
| dist_exponential_skewness(1.0) |
|---|
| 2.0 |
Related functions
- dist_exponential_sample() — Generates a random sample from the exponential distribution with the specified parameters
- dist_exponential_pdf() — Computes the probability density function (PDF) of the exponential distribution at x
- dist_exponential_cdf() — Computes the cumulative distribution function (CDF) of the exponential distribution, P(X <= x)
- dist_exponential_quantile() — Computes the quantile function (inverse CDF) of the exponential distribution
- dist_exponential_mean() — Returns the mean of the exponential distribution
- dist_exponential_stddev() — Returns the standard deviation of the exponential distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
rate
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the standard deviation of the exponential distribution. Returns NULL when it is undefined for the given parameters.
SELECT dist_exponential_stddev(1.0);
Output
| dist_exponential_stddev(1.0) |
|---|
| 1.0 |
Related functions
- dist_exponential_sample() — Generates a random sample from the exponential distribution with the specified parameters
- dist_exponential_pdf() — Computes the probability density function (PDF) of the exponential distribution at x
- dist_exponential_cdf() — Computes the cumulative distribution function (CDF) of the exponential distribution, P(X <= x)
- dist_exponential_quantile() — Computes the quantile function (inverse CDF) of the exponential distribution
- dist_exponential_mean() — Returns the mean of the exponential distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
rate
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the support of the exponential distribution as [min, max].
SELECT dist_exponential_support(1.0);
Output
| dist_exponential_support(1.0) |
|---|
| [0.0, inf] |
Related functions
- dist_exponential_sample() — Generates a random sample from the exponential distribution with the specified parameters
- dist_exponential_pdf() — Computes the probability density function (PDF) of the exponential distribution at x
- dist_exponential_cdf() — Computes the cumulative distribution function (CDF) of the exponential distribution, P(X <= x)
- dist_exponential_quantile() — Computes the quantile function (inverse CDF) of the exponential distribution
- dist_exponential_mean() — Returns the mean of the exponential distribution
- dist_exponential_stddev() — Returns the standard deviation of the exponential distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
rate
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the variance of the exponential distribution. Returns NULL when it is undefined for the given parameters.
SELECT dist_exponential_variance(1.0);
Output
| dist_exponential_variance(1.0) |
|---|
| 1.0 |
Related functions
- dist_exponential_sample() — Generates a random sample from the exponential distribution with the specified parameters
- dist_exponential_pdf() — Computes the probability density function (PDF) of the exponential distribution at x
- dist_exponential_cdf() — Computes the cumulative distribution function (CDF) of the exponential distribution, P(X <= x)
- dist_exponential_quantile() — Computes the quantile function (inverse CDF) of the exponential distribution
- dist_exponential_mean() — Returns the mean of the exponential distribution
- dist_exponential_stddev() — Returns the standard deviation of the exponential distribution