Normal functions in the Stochastic DuckDB extension
Function category
Normal
21 functionsNormal (Gaussian) — the workhorse continuous distribution. Z-scores, confidence intervals, central limit applications.
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 normal distribution. Returns the probability that a random variable X is less than or equal to x.
SELECT dist_normal_cdf(0, 1.0, 0.5);
Output
| dist_normal_cdf(0, 1.0, 0.5) |
|---|
| 0.6914624612740131 |
Related functions
- dist_normal_sample() — Generates random samples from the normal distribution with specified parameters
- dist_normal_pdf() — Computes the probability density function (PDF) of the normal distribution
- dist_normal_quantile() — Computes the quantile function (inverse CDF) of the normal distribution
- dist_normal_mean() — Returns the mean (μ) of the normal distribution, which is the first moment
- dist_normal_stddev() — Returns the standard deviation (σ) of the normal 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 normal distribution. Returns the probability that X > x, equivalent to the survival function.
SELECT dist_normal_cdf_complement(0, 1.0, 0.5);
Output
| dist_normal_cdf_complement(0, 1.0, 0.5) |
|---|
| 0.3085375387259869 |
Related functions
- dist_normal_sample() — Generates random samples from the normal distribution with specified parameters
- dist_normal_pdf() — Computes the probability density function (PDF) of the normal distribution
- dist_normal_cdf() — Computes the cumulative distribution function (CDF) of the normal distribution
- dist_normal_quantile() — Computes the quantile function (inverse CDF) of the normal distribution
- dist_normal_mean() — Returns the mean (μ) of the normal distribution, which is the first moment
- dist_normal_stddev() — Returns the standard deviation (σ) of the normal 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 normal distribution.
SELECT dist_normal_chf(0, 1.0, 0.5);
Output
| dist_normal_chf(0, 1.0, 0.5) |
|---|
| 1.1759117615936188 |
Related functions
- dist_normal_sample() — Generates random samples from the normal distribution with specified parameters
- dist_normal_pdf() — Computes the probability density function (PDF) of the normal distribution
- dist_normal_cdf() — Computes the cumulative distribution function (CDF) of the normal distribution
- dist_normal_quantile() — Computes the quantile function (inverse CDF) of the normal distribution
- dist_normal_mean() — Returns the mean (μ) of the normal distribution, which is the first moment
- dist_normal_stddev() — Returns the standard deviation (σ) of the normal 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 normal distribution.
SELECT dist_normal_hazard(0, 1.0, 0.5);
Output
| dist_normal_hazard(0, 1.0, 0.5) |
|---|
| 1.1410777703680648 |
Related functions
- dist_normal_sample() — Generates random samples from the normal distribution with specified parameters
- dist_normal_pdf() — Computes the probability density function (PDF) of the normal distribution
- dist_normal_cdf() — Computes the cumulative distribution function (CDF) of the normal distribution
- dist_normal_quantile() — Computes the quantile function (inverse CDF) of the normal distribution
- dist_normal_mean() — Returns the mean (μ) of the normal distribution, which is the first moment
- dist_normal_stddev() — Returns the standard deviation (σ) of the normal 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 normal distribution.
SELECT dist_normal_kurtosis(0.0, 1.0);
Output
| dist_normal_kurtosis(0.0, 1.0) |
|---|
| 3.0 |
Related functions
- dist_normal_sample() — Generates random samples from the normal distribution with specified parameters
- dist_normal_pdf() — Computes the probability density function (PDF) of the normal distribution
- dist_normal_cdf() — Computes the cumulative distribution function (CDF) of the normal distribution
- dist_normal_quantile() — Computes the quantile function (inverse CDF) of the normal distribution
- dist_normal_mean() — Returns the mean (μ) of the normal distribution, which is the first moment
- dist_normal_stddev() — Returns the standard deviation (σ) of the normal 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 normal distribution.
SELECT dist_normal_kurtosis_excess(0.0, 1.0);
Output
| dist_normal_kurtosis_excess(0.0, 1.0) |
|---|
| 0.0 |
Related functions
- dist_normal_sample() — Generates random samples from the normal distribution with specified parameters
- dist_normal_pdf() — Computes the probability density function (PDF) of the normal distribution
- dist_normal_cdf() — Computes the cumulative distribution function (CDF) of the normal distribution
- dist_normal_quantile() — Computes the quantile function (inverse CDF) of the normal distribution
- dist_normal_mean() — Returns the mean (μ) of the normal distribution, which is the first moment
- dist_normal_stddev() — Returns the standard deviation (σ) of the normal 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 normal distribution. Returns the logarithm of the probability that a random variable X is less than or equal to x.
SELECT dist_normal_log_cdf(0, 1.0, 0.5);
Output
| dist_normal_log_cdf(0, 1.0, 0.5) |
|---|
| -0.36894641528865635 |
Related functions
- dist_normal_sample() — Generates random samples from the normal distribution with specified parameters
- dist_normal_pdf() — Computes the probability density function (PDF) of the normal distribution
- dist_normal_cdf() — Computes the cumulative distribution function (CDF) of the normal distribution
- dist_normal_quantile() — Computes the quantile function (inverse CDF) of the normal distribution
- dist_normal_mean() — Returns the mean (μ) of the normal distribution, which is the first moment
- dist_normal_stddev() — Returns the standard deviation (σ) of the normal 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 normal distribution. Returns the logarithm of the probability that X > x, equivalent to the survival function.
SELECT dist_normal_log_cdf_complement(0, 1.0, 0.5);
Output
| dist_normal_log_cdf_complement(0, 1.0, 0.5) |
|---|
| -1.1759117615936188 |
Related functions
- dist_normal_sample() — Generates random samples from the normal distribution with specified parameters
- dist_normal_pdf() — Computes the probability density function (PDF) of the normal distribution
- dist_normal_cdf() — Computes the cumulative distribution function (CDF) of the normal distribution
- dist_normal_quantile() — Computes the quantile function (inverse CDF) of the normal distribution
- dist_normal_mean() — Returns the mean (μ) of the normal distribution, which is the first moment
- dist_normal_stddev() — Returns the standard deviation (σ) of the normal 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 normal distribution. Useful for numerical stability when dealing with very small probabilities.
SELECT dist_normal_log_pdf(0, 1.0, 0.5);
Output
| dist_normal_log_pdf(0, 1.0, 0.5) |
|---|
| -1.0439385332046727 |
Related functions
- dist_normal_sample() — Generates random samples from the normal distribution with specified parameters
- dist_normal_pdf() — Computes the probability density function (PDF) of the normal distribution
- dist_normal_cdf() — Computes the cumulative distribution function (CDF) of the normal distribution
- dist_normal_quantile() — Computes the quantile function (inverse CDF) of the normal distribution
- dist_normal_mean() — Returns the mean (μ) of the normal distribution, which is the first moment
- dist_normal_stddev() — Returns the standard deviation (σ) of the normal 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 normal distribution, which is the first moment.
SELECT dist_normal_mean(0.0, 1.0);
Output
| dist_normal_mean(0.0, 1.0) |
|---|
| 0.0 |
Related functions
- dist_normal_sample() — Generates random samples from the normal distribution with specified parameters
- dist_normal_pdf() — Computes the probability density function (PDF) of the normal distribution
- dist_normal_cdf() — Computes the cumulative distribution function (CDF) of the normal distribution
- dist_normal_quantile() — Computes the quantile function (inverse CDF) of the normal distribution
- dist_normal_stddev() — Returns the standard deviation (σ) of the normal 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 normal distribution, which equals the mean.
SELECT dist_normal_median(0.0, 1.0);
Output
| dist_normal_median(0.0, 1.0) |
|---|
| 0.0 |
Related functions
- dist_normal_sample() — Generates random samples from the normal distribution with specified parameters
- dist_normal_pdf() — Computes the probability density function (PDF) of the normal distribution
- dist_normal_cdf() — Computes the cumulative distribution function (CDF) of the normal distribution
- dist_normal_quantile() — Computes the quantile function (inverse CDF) of the normal distribution
- dist_normal_mean() — Returns the mean (μ) of the normal distribution, which is the first moment
- dist_normal_stddev() — Returns the standard deviation (σ) of the normal 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 normal distribution, which equals the mean.
SELECT dist_normal_mode(0.0, 1.0);
Output
| dist_normal_mode(0.0, 1.0) |
|---|
| 0.0 |
Related functions
- dist_normal_sample() — Generates random samples from the normal distribution with specified parameters
- dist_normal_pdf() — Computes the probability density function (PDF) of the normal distribution
- dist_normal_cdf() — Computes the cumulative distribution function (CDF) of the normal distribution
- dist_normal_quantile() — Computes the quantile function (inverse CDF) of the normal distribution
- dist_normal_mean() — Returns the mean (μ) of the normal distribution, which is the first moment
- dist_normal_stddev() — Returns the standard deviation (σ) of the normal 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 normal distribution. Returns the probability densityat point x for a normal distribution with specified parameters.
SELECT dist_normal_pdf(0, 1.0, 0.5);
Output
| dist_normal_pdf(0, 1.0, 0.5) |
|---|
| 0.3520653267642995 |
Related functions
- dist_normal_sample() — Generates random samples from the normal distribution with specified parameters
- dist_normal_cdf() — Computes the cumulative distribution function (CDF) of the normal distribution
- dist_normal_quantile() — Computes the quantile function (inverse CDF) of the normal distribution
- dist_normal_mean() — Returns the mean (μ) of the normal distribution, which is the first moment
- dist_normal_stddev() — Returns the standard deviation (σ) of the normal 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 normal distribution. Returns the value x such that P(X ≤ x) = p, where p is the cumulative probability.
SELECT dist_normal_quantile(0, 1.0, 0.95);
Output
| dist_normal_quantile(0, 1.0, 0.95) |
|---|
| 1.6448536269514729 |
Related functions
- dist_normal_sample() — Generates random samples from the normal distribution with specified parameters
- dist_normal_pdf() — Computes the probability density function (PDF) of the normal distribution
- dist_normal_cdf() — Computes the cumulative distribution function (CDF) of the normal distribution
- dist_normal_mean() — Returns the mean (μ) of the normal distribution, which is the first moment
- dist_normal_stddev() — Returns the standard deviation (σ) of the normal 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 normal distribution. Returns the value x such that P(X > x) = p, useful for computing upper tail quantiles.
SELECT dist_normal_quantile_complement(0, 1.0, 0.95);
Output
| dist_normal_quantile_complement(0, 1.0, 0.95) |
|---|
| -1.6448536269514729 |
Related functions
- dist_normal_sample() — Generates random samples from the normal distribution with specified parameters
- dist_normal_pdf() — Computes the probability density function (PDF) of the normal distribution
- dist_normal_cdf() — Computes the cumulative distribution function (CDF) of the normal distribution
- dist_normal_quantile() — Computes the quantile function (inverse CDF) of the normal distribution
- dist_normal_mean() — Returns the mean (μ) of the normal distribution, which is the first moment
- dist_normal_stddev() — Returns the standard deviation (σ) of the normal 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 normal distribution.
SELECT dist_normal_range(0.0, 1.0);
Output
| dist_normal_range(0.0, 1.0) |
|---|
| (-inf, inf) |
Related functions
- dist_normal_sample() — Generates random samples from the normal distribution with specified parameters
- dist_normal_pdf() — Computes the probability density function (PDF) of the normal distribution
- dist_normal_cdf() — Computes the cumulative distribution function (CDF) of the normal distribution
- dist_normal_quantile() — Computes the quantile function (inverse CDF) of the normal distribution
- dist_normal_mean() — Returns the mean (μ) of the normal distribution, which is the first moment
- dist_normal_stddev() — Returns the standard deviation (σ) of the normal 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 normal distribution with specified parameters.
SELECT dist_normal_sample(0.0, 1.0);
Output
| dist_normal_sample(0.0, 1.0) |
|---|
| 1.5755583945911054 |
Related functions
- dist_normal_pdf() — Computes the probability density function (PDF) of the normal distribution
- dist_normal_cdf() — Computes the cumulative distribution function (CDF) of the normal distribution
- dist_normal_quantile() — Computes the quantile function (inverse CDF) of the normal distribution
- dist_normal_mean() — Returns the mean (μ) of the normal distribution, which is the first moment
- dist_normal_stddev() — Returns the standard deviation (σ) of the normal 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 normal distribution.
SELECT dist_normal_skewness(0.0, 1.0);
Output
| dist_normal_skewness(0.0, 1.0) |
|---|
| 0.0 |
Related functions
- dist_normal_sample() — Generates random samples from the normal distribution with specified parameters
- dist_normal_pdf() — Computes the probability density function (PDF) of the normal distribution
- dist_normal_cdf() — Computes the cumulative distribution function (CDF) of the normal distribution
- dist_normal_quantile() — Computes the quantile function (inverse CDF) of the normal distribution
- dist_normal_mean() — Returns the mean (μ) of the normal distribution, which is the first moment
- dist_normal_stddev() — Returns the standard deviation (σ) of the normal 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 normal distribution.
SELECT dist_normal_stddev(0.0, 1.0);
Output
| dist_normal_stddev(0.0, 1.0) |
|---|
| 1.0 |
Related functions
- dist_normal_sample() — Generates random samples from the normal distribution with specified parameters
- dist_normal_pdf() — Computes the probability density function (PDF) of the normal distribution
- dist_normal_cdf() — Computes the cumulative distribution function (CDF) of the normal distribution
- dist_normal_quantile() — Computes the quantile function (inverse CDF) of the normal distribution
- dist_normal_mean() — Returns the mean (μ) of the normal 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 normal distribution.
SELECT dist_normal_support(0.0, 1.0);
Output
| dist_normal_support(0.0, 1.0) |
|---|
| (-inf, inf) |
Related functions
- dist_normal_sample() — Generates random samples from the normal distribution with specified parameters
- dist_normal_pdf() — Computes the probability density function (PDF) of the normal distribution
- dist_normal_cdf() — Computes the cumulative distribution function (CDF) of the normal distribution
- dist_normal_quantile() — Computes the quantile function (inverse CDF) of the normal distribution
- dist_normal_mean() — Returns the mean (μ) of the normal distribution, which is the first moment
- dist_normal_stddev() — Returns the standard deviation (σ) of the normal 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 normal distribution.
SELECT dist_normal_variance(0.0, 1.0);
Output
| dist_normal_variance(0.0, 1.0) |
|---|
| 1.0 |
Related functions
- dist_normal_sample() — Generates random samples from the normal distribution with specified parameters
- dist_normal_pdf() — Computes the probability density function (PDF) of the normal distribution
- dist_normal_cdf() — Computes the cumulative distribution function (CDF) of the normal distribution
- dist_normal_quantile() — Computes the quantile function (inverse CDF) of the normal distribution
- dist_normal_mean() — Returns the mean (μ) of the normal distribution, which is the first moment
- dist_normal_stddev() — Returns the standard deviation (σ) of the normal distribution