Log-normal functions in the Stochastic DuckDB extension
Function category
Log-normal
21 functionsLog-normal — exp of a Normal. Models multiplicative growth, income, lifetimes; right-skewed with heavy tail.
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
mean
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
stddev
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
x
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Computes the cumulative distribution function (CDF) of the lognormal distribution. Returns the probability that a random variable X is less than or equal to x.
SELECT dist_lognormal_cdf(0, 1.0, 0.5);
Output
| dist_lognormal_cdf(0, 1.0, 0.5) |
|---|
| 0.24410859578558275 |
Related functions
- dist_lognormal_sample() — Generates random samples from the lognormal distribution with specified parameters
- dist_lognormal_pdf() — Computes the probability density function (PDF) of the lognormal distribution
- dist_lognormal_quantile() — Computes the quantile function (inverse CDF) of the lognormal distribution
- dist_lognormal_mean() — Returns the mean (μ) of the lognormal distribution, which is the first moment
- dist_lognormal_stddev() — Returns the standard deviation (σ) of the lognormal distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
mean
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
stddev
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
x
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Computes the complementary cumulative distribution function (1 - CDF) of the lognormal distribution. Returns the probability that X > x, equivalent to the survival function.
SELECT dist_lognormal_cdf_complement(0, 1.0, 0.5);
Output
| dist_lognormal_cdf_complement(0, 1.0, 0.5) |
|---|
| 0.7558914042144173 |
Related functions
- dist_lognormal_sample() — Generates random samples from the lognormal distribution with specified parameters
- dist_lognormal_pdf() — Computes the probability density function (PDF) of the lognormal distribution
- dist_lognormal_cdf() — Computes the cumulative distribution function (CDF) of the lognormal distribution
- dist_lognormal_quantile() — Computes the quantile function (inverse CDF) of the lognormal distribution
- dist_lognormal_mean() — Returns the mean (μ) of the lognormal distribution, which is the first moment
- dist_lognormal_stddev() — Returns the standard deviation (σ) of the lognormal distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
mean
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
stddev
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
x
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Computes the cumulative hazard function of the lognormal distribution.
SELECT dist_lognormal_chf(0, 1.0, 0.5);
Output
| dist_lognormal_chf(0, 1.0, 0.5) |
|---|
| 0.2798575583395914 |
Related functions
- dist_lognormal_sample() — Generates random samples from the lognormal distribution with specified parameters
- dist_lognormal_pdf() — Computes the probability density function (PDF) of the lognormal distribution
- dist_lognormal_cdf() — Computes the cumulative distribution function (CDF) of the lognormal distribution
- dist_lognormal_quantile() — Computes the quantile function (inverse CDF) of the lognormal distribution
- dist_lognormal_mean() — Returns the mean (μ) of the lognormal distribution, which is the first moment
- dist_lognormal_stddev() — Returns the standard deviation (σ) of the lognormal distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
mean
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
stddev
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
x
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Computes the hazard function of the lognormal distribution.
SELECT dist_lognormal_hazard(0, 1.0, 0.5);
Output
| dist_lognormal_hazard(0, 1.0, 0.5) |
|---|
| 0.8301405117419856 |
Related functions
- dist_lognormal_sample() — Generates random samples from the lognormal distribution with specified parameters
- dist_lognormal_pdf() — Computes the probability density function (PDF) of the lognormal distribution
- dist_lognormal_cdf() — Computes the cumulative distribution function (CDF) of the lognormal distribution
- dist_lognormal_quantile() — Computes the quantile function (inverse CDF) of the lognormal distribution
- dist_lognormal_mean() — Returns the mean (μ) of the lognormal distribution, which is the first moment
- dist_lognormal_stddev() — Returns the standard deviation (σ) of the lognormal distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
mean
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
stddev
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the kurtosis of the lognormal distribution.
SELECT dist_lognormal_kurtosis(0.0, 1.0);
Output
| dist_lognormal_kurtosis(0.0, 1.0) |
|---|
| 113.93639217631153 |
Related functions
- dist_lognormal_sample() — Generates random samples from the lognormal distribution with specified parameters
- dist_lognormal_pdf() — Computes the probability density function (PDF) of the lognormal distribution
- dist_lognormal_cdf() — Computes the cumulative distribution function (CDF) of the lognormal distribution
- dist_lognormal_quantile() — Computes the quantile function (inverse CDF) of the lognormal distribution
- dist_lognormal_mean() — Returns the mean (μ) of the lognormal distribution, which is the first moment
- dist_lognormal_stddev() — Returns the standard deviation (σ) of the lognormal distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
mean
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
stddev
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the excess kurtosis of the lognormal distribution.
SELECT dist_lognormal_kurtosis_excess(0.0, 1.0);
Output
| dist_lognormal_kurtosis_excess(0.0, 1.0) |
|---|
| 110.93639217631153 |
Related functions
- dist_lognormal_sample() — Generates random samples from the lognormal distribution with specified parameters
- dist_lognormal_pdf() — Computes the probability density function (PDF) of the lognormal distribution
- dist_lognormal_cdf() — Computes the cumulative distribution function (CDF) of the lognormal distribution
- dist_lognormal_quantile() — Computes the quantile function (inverse CDF) of the lognormal distribution
- dist_lognormal_mean() — Returns the mean (μ) of the lognormal distribution, which is the first moment
- dist_lognormal_stddev() — Returns the standard deviation (σ) of the lognormal distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
mean
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
stddev
|
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 lognormal distribution. Returns the logarithm of the probability that a random variable X is less than or equal to x.
SELECT dist_lognormal_log_cdf(0, 1.0, 0.5);
Output
| dist_lognormal_log_cdf(0, 1.0, 0.5) |
|---|
| -1.4101420880058386 |
Related functions
- dist_lognormal_sample() — Generates random samples from the lognormal distribution with specified parameters
- dist_lognormal_pdf() — Computes the probability density function (PDF) of the lognormal distribution
- dist_lognormal_cdf() — Computes the cumulative distribution function (CDF) of the lognormal distribution
- dist_lognormal_quantile() — Computes the quantile function (inverse CDF) of the lognormal distribution
- dist_lognormal_mean() — Returns the mean (μ) of the lognormal distribution, which is the first moment
- dist_lognormal_stddev() — Returns the standard deviation (σ) of the lognormal distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
mean
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
stddev
|
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 lognormal distribution. Returns the logarithm of the probability that X > x, equivalent to the survival function.
SELECT dist_lognormal_log_cdf_complement(0, 1.0, 0.5);
Output
| dist_lognormal_log_cdf_complement(0, 1.0, 0.5) |
|---|
| -0.2798575583395914 |
Related functions
- dist_lognormal_sample() — Generates random samples from the lognormal distribution with specified parameters
- dist_lognormal_pdf() — Computes the probability density function (PDF) of the lognormal distribution
- dist_lognormal_cdf() — Computes the cumulative distribution function (CDF) of the lognormal distribution
- dist_lognormal_quantile() — Computes the quantile function (inverse CDF) of the lognormal distribution
- dist_lognormal_mean() — Returns the mean (μ) of the lognormal distribution, which is the first moment
- dist_lognormal_stddev() — Returns the standard deviation (σ) of the lognormal distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
mean
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
stddev
|
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 lognormal distribution. Useful for numerical stability when dealing with very small probabilities.
SELECT dist_lognormal_log_pdf(0, 1.0, 0.5);
Output
| dist_lognormal_log_pdf(0, 1.0, 0.5) |
|---|
| -0.46601785960382813 |
Related functions
- dist_lognormal_sample() — Generates random samples from the lognormal distribution with specified parameters
- dist_lognormal_pdf() — Computes the probability density function (PDF) of the lognormal distribution
- dist_lognormal_cdf() — Computes the cumulative distribution function (CDF) of the lognormal distribution
- dist_lognormal_quantile() — Computes the quantile function (inverse CDF) of the lognormal distribution
- dist_lognormal_mean() — Returns the mean (μ) of the lognormal distribution, which is the first moment
- dist_lognormal_stddev() — Returns the standard deviation (σ) of the lognormal distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
mean
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
stddev
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the mean (μ) of the lognormal distribution, which is the first moment.
SELECT dist_lognormal_mean(0.0, 1.0);
Output
| dist_lognormal_mean(0.0, 1.0) |
|---|
| 1.6487212707001282 |
Related functions
- dist_lognormal_sample() — Generates random samples from the lognormal distribution with specified parameters
- dist_lognormal_pdf() — Computes the probability density function (PDF) of the lognormal distribution
- dist_lognormal_cdf() — Computes the cumulative distribution function (CDF) of the lognormal distribution
- dist_lognormal_quantile() — Computes the quantile function (inverse CDF) of the lognormal distribution
- dist_lognormal_stddev() — Returns the standard deviation (σ) of the lognormal distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
mean
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
stddev
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the median (50th percentile) of the lognormal distribution, which equals the mean.
SELECT dist_lognormal_median(0.0, 1.0);
Output
| dist_lognormal_median(0.0, 1.0) |
|---|
| 1.0 |
Related functions
- dist_lognormal_sample() — Generates random samples from the lognormal distribution with specified parameters
- dist_lognormal_pdf() — Computes the probability density function (PDF) of the lognormal distribution
- dist_lognormal_cdf() — Computes the cumulative distribution function (CDF) of the lognormal distribution
- dist_lognormal_quantile() — Computes the quantile function (inverse CDF) of the lognormal distribution
- dist_lognormal_mean() — Returns the mean (μ) of the lognormal distribution, which is the first moment
- dist_lognormal_stddev() — Returns the standard deviation (σ) of the lognormal distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
mean
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
stddev
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the mode (most likely value) of the lognormal distribution, which equals the mean.
SELECT dist_lognormal_mode(0.0, 1.0);
Output
| dist_lognormal_mode(0.0, 1.0) |
|---|
| 0.36787944117144233 |
Related functions
- dist_lognormal_sample() — Generates random samples from the lognormal distribution with specified parameters
- dist_lognormal_pdf() — Computes the probability density function (PDF) of the lognormal distribution
- dist_lognormal_cdf() — Computes the cumulative distribution function (CDF) of the lognormal distribution
- dist_lognormal_quantile() — Computes the quantile function (inverse CDF) of the lognormal distribution
- dist_lognormal_mean() — Returns the mean (μ) of the lognormal distribution, which is the first moment
- dist_lognormal_stddev() — Returns the standard deviation (σ) of the lognormal distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
mean
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
stddev
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
x
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Computes the probability density function (PDF) of the lognormal distribution. Returns the probability densityat point x for a lognormal distribution with specified parameters.
SELECT dist_lognormal_pdf(0, 1.0, 0.5);
Output
| dist_lognormal_pdf(0, 1.0, 0.5) |
|---|
| 0.6274960771159244 |
Related functions
- dist_lognormal_sample() — Generates random samples from the lognormal distribution with specified parameters
- dist_lognormal_cdf() — Computes the cumulative distribution function (CDF) of the lognormal distribution
- dist_lognormal_quantile() — Computes the quantile function (inverse CDF) of the lognormal distribution
- dist_lognormal_mean() — Returns the mean (μ) of the lognormal distribution, which is the first moment
- dist_lognormal_stddev() — Returns the standard deviation (σ) of the lognormal distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
mean
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
stddev
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
p
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Computes the quantile function (inverse CDF) of the lognormal distribution. Returns the value x such that P(X ≤ x) = p, where p is the cumulative probability.
SELECT dist_lognormal_quantile(0, 1.0, 0.95);
Output
| dist_lognormal_quantile(0, 1.0, 0.95) |
|---|
| 5.1802516022330165 |
Related functions
- dist_lognormal_sample() — Generates random samples from the lognormal distribution with specified parameters
- dist_lognormal_pdf() — Computes the probability density function (PDF) of the lognormal distribution
- dist_lognormal_cdf() — Computes the cumulative distribution function (CDF) of the lognormal distribution
- dist_lognormal_mean() — Returns the mean (μ) of the lognormal distribution, which is the first moment
- dist_lognormal_stddev() — Returns the standard deviation (σ) of the lognormal distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
mean
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
stddev
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
p
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Computes the complementary quantile function of the lognormal distribution. Returns the value x such that P(X > x) = p, useful for computing upper tail quantiles.
SELECT dist_lognormal_quantile_complement(0, 1.0, 0.95);
Output
| dist_lognormal_quantile_complement(0, 1.0, 0.95) |
|---|
| 0.19304081669873652 |
Related functions
- dist_lognormal_sample() — Generates random samples from the lognormal distribution with specified parameters
- dist_lognormal_pdf() — Computes the probability density function (PDF) of the lognormal distribution
- dist_lognormal_cdf() — Computes the cumulative distribution function (CDF) of the lognormal distribution
- dist_lognormal_quantile() — Computes the quantile function (inverse CDF) of the lognormal distribution
- dist_lognormal_mean() — Returns the mean (μ) of the lognormal distribution, which is the first moment
- dist_lognormal_stddev() — Returns the standard deviation (σ) of the lognormal distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
mean
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
stddev
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the range of the lognormal distribution.
SELECT dist_lognormal_range(0.0, 1.0);
Output
| dist_lognormal_range(0.0, 1.0) |
|---|
| (0.0, 1.7976931348623157e+308) |
Related functions
- dist_lognormal_sample() — Generates random samples from the lognormal distribution with specified parameters
- dist_lognormal_pdf() — Computes the probability density function (PDF) of the lognormal distribution
- dist_lognormal_cdf() — Computes the cumulative distribution function (CDF) of the lognormal distribution
- dist_lognormal_quantile() — Computes the quantile function (inverse CDF) of the lognormal distribution
- dist_lognormal_mean() — Returns the mean (μ) of the lognormal distribution, which is the first moment
- dist_lognormal_stddev() — Returns the standard deviation (σ) of the lognormal distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
mean
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
stddev
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Generates random samples from the lognormal distribution with specified parameters.
SELECT dist_lognormal_sample(0.0, 1.0);
Output
| dist_lognormal_sample(0.0, 1.0) |
|---|
| 0.3878694886996256 |
Related functions
- dist_lognormal_pdf() — Computes the probability density function (PDF) of the lognormal distribution
- dist_lognormal_cdf() — Computes the cumulative distribution function (CDF) of the lognormal distribution
- dist_lognormal_quantile() — Computes the quantile function (inverse CDF) of the lognormal distribution
- dist_lognormal_mean() — Returns the mean (μ) of the lognormal distribution, which is the first moment
- dist_lognormal_stddev() — Returns the standard deviation (σ) of the lognormal distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
mean
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
stddev
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the skewness of the lognormal distribution.
SELECT dist_lognormal_skewness(0.0, 1.0);
Output
| dist_lognormal_skewness(0.0, 1.0) |
|---|
| 6.184877138632554 |
Related functions
- dist_lognormal_sample() — Generates random samples from the lognormal distribution with specified parameters
- dist_lognormal_pdf() — Computes the probability density function (PDF) of the lognormal distribution
- dist_lognormal_cdf() — Computes the cumulative distribution function (CDF) of the lognormal distribution
- dist_lognormal_quantile() — Computes the quantile function (inverse CDF) of the lognormal distribution
- dist_lognormal_mean() — Returns the mean (μ) of the lognormal distribution, which is the first moment
- dist_lognormal_stddev() — Returns the standard deviation (σ) of the lognormal distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
mean
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
stddev
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the standard deviation (σ) of the lognormal distribution.
SELECT dist_lognormal_stddev(0.0, 1.0);
Output
| dist_lognormal_stddev(0.0, 1.0) |
|---|
| 2.1611974158950877 |
Related functions
- dist_lognormal_sample() — Generates random samples from the lognormal distribution with specified parameters
- dist_lognormal_pdf() — Computes the probability density function (PDF) of the lognormal distribution
- dist_lognormal_cdf() — Computes the cumulative distribution function (CDF) of the lognormal distribution
- dist_lognormal_quantile() — Computes the quantile function (inverse CDF) of the lognormal distribution
- dist_lognormal_mean() — Returns the mean (μ) of the lognormal distribution, which is the first moment
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
mean
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
stddev
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the support of the lognormal distribution.
SELECT dist_lognormal_support(0.0, 1.0);
Output
| dist_lognormal_support(0.0, 1.0) |
|---|
| (0.0, 1.7976931348623157e+308) |
Related functions
- dist_lognormal_sample() — Generates random samples from the lognormal distribution with specified parameters
- dist_lognormal_pdf() — Computes the probability density function (PDF) of the lognormal distribution
- dist_lognormal_cdf() — Computes the cumulative distribution function (CDF) of the lognormal distribution
- dist_lognormal_quantile() — Computes the quantile function (inverse CDF) of the lognormal distribution
- dist_lognormal_mean() — Returns the mean (μ) of the lognormal distribution, which is the first moment
- dist_lognormal_stddev() — Returns the standard deviation (σ) of the lognormal distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
mean
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
stddev
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the variance (σ²) of the lognormal distribution.
SELECT dist_lognormal_variance(0.0, 1.0);
Output
| dist_lognormal_variance(0.0, 1.0) |
|---|
| 4.670774270471605 |
Related functions
- dist_lognormal_sample() — Generates random samples from the lognormal distribution with specified parameters
- dist_lognormal_pdf() — Computes the probability density function (PDF) of the lognormal distribution
- dist_lognormal_cdf() — Computes the cumulative distribution function (CDF) of the lognormal distribution
- dist_lognormal_quantile() — Computes the quantile function (inverse CDF) of the lognormal distribution
- dist_lognormal_mean() — Returns the mean (μ) of the lognormal distribution, which is the first moment
- dist_lognormal_stddev() — Returns the standard deviation (σ) of the lognormal distribution