Weibull functions in the Stochastic DuckDB extension
Function category
Weibull
24 functionsWeibull distribution — flexible shape/scale. Reliability engineering, time-to-failure, wind-speed modeling.
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
shape
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
scale
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
x
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Computes the cumulative distribution function (CDF) of the Weibull distribution, P(X <= x).
SELECT dist_weibull_cdf(1.5, 1.0, 0.5);
Output
| dist_weibull_cdf(1.5, 1.0, 0.5) |
|---|
| 0.2978114986734404 |
Related functions
- dist_weibull_sample() — Generates a random sample from the Weibull distribution with the specified parameters
- dist_weibull_pdf() — Computes the probability density function (PDF) of the Weibull distribution at x
- dist_weibull_quantile() — Computes the quantile function (inverse CDF) of the Weibull distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
shape
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
scale
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
x
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Computes the complementary cumulative distribution function (survival function) of the Weibull distribution, P(X > x).
SELECT dist_weibull_cdf_complement(1.5, 1.0, 0.5);
Output
| dist_weibull_cdf_complement(1.5, 1.0, 0.5) |
|---|
| 0.7021885013265596 |
Related functions
- dist_weibull_sample() — Generates a random sample from the Weibull distribution with the specified parameters
- dist_weibull_pdf() — Computes the probability density function (PDF) of the Weibull distribution at x
- dist_weibull_cdf() — Computes the cumulative distribution function (CDF) of the Weibull distribution, P(X <= x)
- dist_weibull_quantile() — Computes the quantile function (inverse CDF) of the Weibull distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
shape
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
scale
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
x
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Computes the cumulative hazard function of the Weibull distribution at x.
SELECT dist_weibull_chf(1.5, 1.0, 0.5);
Output
| dist_weibull_chf(1.5, 1.0, 0.5) |
|---|
| 0.35355339059327373 |
Related functions
- dist_weibull_sample() — Generates a random sample from the Weibull distribution with the specified parameters
- dist_weibull_pdf() — Computes the probability density function (PDF) of the Weibull distribution at x
- dist_weibull_cdf() — Computes the cumulative distribution function (CDF) of the Weibull distribution, P(X <= x)
- dist_weibull_quantile() — Computes the quantile function (inverse CDF) of the Weibull distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
x
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Fits a Weibull distribution to x by maximum likelihood (Newton's method). Returns a STRUCT with the fitted parameters (shape, scale) followed by the log_likelihood, aic and bic of the fit, or NULL when there are too few or only identical values. The whole sample is held in memory.
SELECT dist_weibull_fit(x) AS fit
FROM (VALUES (2.1), (3.4), (1.7), (4.0), (2.8), (3.1), (1.2), (2.5)) t(x);
Output
| fit |
|---|
| {'shape': 3.4183090905293314, 'scale': 2.90120446838219, 'log_likelihood': -10.022056053941597, 'aic': 24.044112107883194, 'bic': 24.202995191242866} |
Related functions
- dist_weibull_ks_test() — One-sample Kolmogorov-Smirnov test of whether x follows the Weibull distribution with the given parameters
- dist_weibull_pdf() — Computes the probability density function (PDF) of the Weibull distribution at x
- dist_weibull_cdf() — Computes the cumulative distribution function (CDF) of the Weibull distribution, P(X <= x)
- dist_weibull_sample() — Generates a random sample from the Weibull distribution with the specified parameters
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
shape
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
scale
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
x
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Computes the hazard function of the Weibull distribution at x.
SELECT dist_weibull_hazard(1.5, 1.0, 0.5);
Output
| dist_weibull_hazard(1.5, 1.0, 0.5) |
|---|
| 1.0606601717798214 |
Related functions
- dist_weibull_sample() — Generates a random sample from the Weibull distribution with the specified parameters
- dist_weibull_pdf() — Computes the probability density function (PDF) of the Weibull distribution at x
- dist_weibull_cdf() — Computes the cumulative distribution function (CDF) of the Weibull distribution, P(X <= x)
- dist_weibull_quantile() — Computes the quantile function (inverse CDF) of the Weibull distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
x
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
shape
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
scale
|
Type
DOUBLE
|
Mode Positional | Description |
Description
One-sample Kolmogorov-Smirnov test of whether x follows the Weibull distribution with the given parameters. Returns the statistic D and the asymptotic p-value.
SELECT dist_weibull_ks_test(x, 1.5, 1.0) AS ks
FROM (VALUES (1.2), (0.7), (2.9), (1.8), (0.4), (3.6), (1.1), (2.2), (5.3), (0.9)) t(x);
Output
| ks |
|---|
| {'statistic': 0.4106284978663306, 'p_value': 0.06861744510567767} |
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
shape
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
scale
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the kurtosis of the Weibull distribution. Returns NULL when it is undefined for the given parameters.
SELECT dist_weibull_kurtosis(1.5, 1.0);
Output
| dist_weibull_kurtosis(1.5, 1.0) |
|---|
| 4.3904035615957975 |
Related functions
- dist_weibull_sample() — Generates a random sample from the Weibull distribution with the specified parameters
- dist_weibull_pdf() — Computes the probability density function (PDF) of the Weibull distribution at x
- dist_weibull_cdf() — Computes the cumulative distribution function (CDF) of the Weibull distribution, P(X <= x)
- dist_weibull_quantile() — Computes the quantile function (inverse CDF) of the Weibull distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
shape
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
scale
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the excess kurtosis of the Weibull distribution. Returns NULL when it is undefined for the given parameters.
SELECT dist_weibull_kurtosis_excess(1.5, 1.0);
Output
| dist_weibull_kurtosis_excess(1.5, 1.0) |
|---|
| 1.3904035615957977 |
Related functions
- dist_weibull_sample() — Generates a random sample from the Weibull distribution with the specified parameters
- dist_weibull_pdf() — Computes the probability density function (PDF) of the Weibull distribution at x
- dist_weibull_cdf() — Computes the cumulative distribution function (CDF) of the Weibull distribution, P(X <= x)
- dist_weibull_quantile() — Computes the quantile function (inverse CDF) of the Weibull distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
shape
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
scale
|
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 Weibull distribution.
SELECT dist_weibull_log_cdf(1.5, 1.0, 0.5);
Output
| dist_weibull_log_cdf(1.5, 1.0, 0.5) |
|---|
| -1.211294547411032 |
Related functions
- dist_weibull_sample() — Generates a random sample from the Weibull distribution with the specified parameters
- dist_weibull_pdf() — Computes the probability density function (PDF) of the Weibull distribution at x
- dist_weibull_cdf() — Computes the cumulative distribution function (CDF) of the Weibull distribution, P(X <= x)
- dist_weibull_quantile() — Computes the quantile function (inverse CDF) of the Weibull distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
shape
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
scale
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
x
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Computes the natural logarithm of the survival function of the Weibull distribution, log P(X > x).
SELECT dist_weibull_log_cdf_complement(1.5, 1.0, 0.5);
Output
| dist_weibull_log_cdf_complement(1.5, 1.0, 0.5) |
|---|
| -0.3535533905932738 |
Related functions
- dist_weibull_sample() — Generates a random sample from the Weibull distribution with the specified parameters
- dist_weibull_pdf() — Computes the probability density function (PDF) of the Weibull distribution at x
- dist_weibull_cdf() — Computes the cumulative distribution function (CDF) of the Weibull distribution, P(X <= x)
- dist_weibull_quantile() — Computes the quantile function (inverse CDF) of the Weibull distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
shape
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
scale
|
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 Weibull distribution at x. Useful for numerical stability when dealing with very small probabilities.
SELECT dist_weibull_log_pdf(1.5, 1.0, 0.5);
Output
| dist_weibull_log_pdf(1.5, 1.0, 0.5) |
|---|
| -0.29466187276508204 |
Related functions
- dist_weibull_sample() — Generates a random sample from the Weibull distribution with the specified parameters
- dist_weibull_pdf() — Computes the probability density function (PDF) of the Weibull distribution at x
- dist_weibull_cdf() — Computes the cumulative distribution function (CDF) of the Weibull distribution, P(X <= x)
- dist_weibull_quantile() — Computes the quantile function (inverse CDF) of the Weibull distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
shape
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
scale
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the mean of the Weibull distribution. Returns NULL when it is undefined for the given parameters.
SELECT dist_weibull_mean(1.5, 1.0);
Output
| dist_weibull_mean(1.5, 1.0) |
|---|
| 0.9027452929509342 |
Related functions
- dist_weibull_sample() — Generates a random sample from the Weibull distribution with the specified parameters
- dist_weibull_pdf() — Computes the probability density function (PDF) of the Weibull distribution at x
- dist_weibull_quantile() — Computes the quantile function (inverse CDF) of the Weibull distribution
- dist_weibull_stddev() — Returns the standard deviation of the Weibull distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
shape
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
scale
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the median of the Weibull distribution. Returns NULL when it is undefined for the given parameters.
SELECT dist_weibull_median(1.5, 1.0);
Output
| dist_weibull_median(1.5, 1.0) |
|---|
| 0.7832197687746514 |
Related functions
- dist_weibull_sample() — Generates a random sample from the Weibull distribution with the specified parameters
- dist_weibull_pdf() — Computes the probability density function (PDF) of the Weibull distribution at x
- dist_weibull_cdf() — Computes the cumulative distribution function (CDF) of the Weibull distribution, P(X <= x)
- dist_weibull_quantile() — Computes the quantile function (inverse CDF) of the Weibull distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
shape
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
scale
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the mode (most likely value) of the Weibull distribution. Returns NULL when it is undefined for the given parameters.
SELECT dist_weibull_mode(1.5, 1.0);
Output
| dist_weibull_mode(1.5, 1.0) |
|---|
| 0.4807498567691361 |
Related functions
- dist_weibull_sample() — Generates a random sample from the Weibull distribution with the specified parameters
- dist_weibull_pdf() — Computes the probability density function (PDF) of the Weibull distribution at x
- dist_weibull_cdf() — Computes the cumulative distribution function (CDF) of the Weibull distribution, P(X <= x)
- dist_weibull_quantile() — Computes the quantile function (inverse CDF) of the Weibull distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
shape
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
scale
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
x
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Computes the probability density function (PDF) of the Weibull distribution at x.
SELECT dist_weibull_pdf(1.5, 1.0, 0.5);
Output
| dist_weibull_pdf(1.5, 1.0, 0.5) |
|---|
| 0.7447833764388441 |
Related functions
- dist_weibull_sample() — Generates a random sample from the Weibull distribution with the specified parameters
- dist_weibull_cdf() — Computes the cumulative distribution function (CDF) of the Weibull distribution, P(X <= x)
- dist_weibull_quantile() — Computes the quantile function (inverse CDF) of the Weibull distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
shape
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
scale
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
p
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Computes the quantile function (inverse CDF) of the Weibull distribution. Returns the smallest x such that P(X <= x) >= p.
SELECT dist_weibull_quantile(1.5, 1.0, 0.95);
Output
| dist_weibull_quantile(1.5, 1.0, 0.95) |
|---|
| 2.0781106375345564 |
Related functions
- dist_weibull_sample() — Generates a random sample from the Weibull distribution with the specified parameters
- dist_weibull_pdf() — Computes the probability density function (PDF) of the Weibull distribution at x
- dist_weibull_cdf() — Computes the cumulative distribution function (CDF) of the Weibull distribution, P(X <= x)
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
shape
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
scale
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
p
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Computes the complementary quantile function of the Weibull distribution. Returns x such that P(X > x) = p, useful for upper tail quantiles.
SELECT dist_weibull_quantile_complement(1.5, 1.0, 0.95);
Output
| dist_weibull_quantile_complement(1.5, 1.0, 0.95) |
|---|
| 0.13805126655628425 |
Related functions
- dist_weibull_sample() — Generates a random sample from the Weibull distribution with the specified parameters
- dist_weibull_pdf() — Computes the probability density function (PDF) of the Weibull distribution at x
- dist_weibull_cdf() — Computes the cumulative distribution function (CDF) of the Weibull distribution, P(X <= x)
- dist_weibull_quantile() — Computes the quantile function (inverse CDF) of the Weibull distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
shape
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
scale
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the range of the Weibull distribution as [min, max].
SELECT dist_weibull_range(1.5, 1.0);
Output
| dist_weibull_range(1.5, 1.0) |
|---|
| [0.0, inf] |
Related functions
- dist_weibull_sample() — Generates a random sample from the Weibull distribution with the specified parameters
- dist_weibull_pdf() — Computes the probability density function (PDF) of the Weibull distribution at x
- dist_weibull_cdf() — Computes the cumulative distribution function (CDF) of the Weibull distribution, P(X <= x)
- dist_weibull_quantile() — Computes the quantile function (inverse CDF) of the Weibull distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
shape
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
scale
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Generates a random sample from the Weibull distribution with the specified parameters.
SELECT dist_weibull_sample(1.5, 1.0);
Output
| dist_weibull_sample(1.5, 1.0) |
|---|
| 0.14026740463552204 |
Related functions
- dist_weibull_pdf() — Computes the probability density function (PDF) of the Weibull distribution at x
- dist_weibull_cdf() — Computes the cumulative distribution function (CDF) of the Weibull distribution, P(X <= x)
- dist_weibull_quantile() — Computes the quantile function (inverse CDF) of the Weibull distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
shape
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
scale
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
n
|
Type
BIGINT
|
Mode Positional | Description |
Description
Generates a list of n random samples from the Weibull distribution with the specified parameters.
SELECT dist_weibull_samples(1.5, 1.0, 5);
Output
| dist_weibull_samples(1.5, 1.0, 5) |
|---|
| [0.1018572950236784, 0.4111524401216253, 1.3306541860568213, 0.6262324396807161, 0.8353128188428297] |
Related functions
- dist_weibull_sample() — Generates a random sample from the Weibull distribution with the specified parameters
- dist_weibull_pdf() — Computes the probability density function (PDF) of the Weibull distribution at x
- dist_weibull_quantile() — Computes the quantile function (inverse CDF) of the Weibull distribution
- dist_weibull_mean() — Returns the mean of the Weibull distribution
- dist_weibull_stddev() — Returns the standard deviation of the Weibull distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
shape
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
scale
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the skewness of the Weibull distribution. Returns NULL when it is undefined for the given parameters.
SELECT dist_weibull_skewness(1.5, 1.0);
Output
| dist_weibull_skewness(1.5, 1.0) |
|---|
| 1.0719865728909461 |
Related functions
- dist_weibull_sample() — Generates a random sample from the Weibull distribution with the specified parameters
- dist_weibull_pdf() — Computes the probability density function (PDF) of the Weibull distribution at x
- dist_weibull_cdf() — Computes the cumulative distribution function (CDF) of the Weibull distribution, P(X <= x)
- dist_weibull_quantile() — Computes the quantile function (inverse CDF) of the Weibull distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
shape
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
scale
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the standard deviation of the Weibull distribution. Returns NULL when it is undefined for the given parameters.
SELECT dist_weibull_stddev(1.5, 1.0);
Output
| dist_weibull_stddev(1.5, 1.0) |
|---|
| 0.6129357917546764 |
Related functions
- dist_weibull_sample() — Generates a random sample from the Weibull distribution with the specified parameters
- dist_weibull_pdf() — Computes the probability density function (PDF) of the Weibull distribution at x
- dist_weibull_quantile() — Computes the quantile function (inverse CDF) of the Weibull distribution
- dist_weibull_mean() — Returns the mean of the Weibull distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
shape
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
scale
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the support of the Weibull distribution as [min, max].
SELECT dist_weibull_support(1.5, 1.0);
Output
| dist_weibull_support(1.5, 1.0) |
|---|
| [0.0, inf] |
Related functions
- dist_weibull_sample() — Generates a random sample from the Weibull distribution with the specified parameters
- dist_weibull_pdf() — Computes the probability density function (PDF) of the Weibull distribution at x
- dist_weibull_cdf() — Computes the cumulative distribution function (CDF) of the Weibull distribution, P(X <= x)
- dist_weibull_quantile() — Computes the quantile function (inverse CDF) of the Weibull distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
shape
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
scale
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the variance of the Weibull distribution. Returns NULL when it is undefined for the given parameters.
SELECT dist_weibull_variance(1.5, 1.0);
Output
| dist_weibull_variance(1.5, 1.0) |
|---|
| 0.3756902848139321 |
Related functions
- dist_weibull_sample() — Generates a random sample from the Weibull distribution with the specified parameters
- dist_weibull_pdf() — Computes the probability density function (PDF) of the Weibull distribution at x
- dist_weibull_cdf() — Computes the cumulative distribution function (CDF) of the Weibull distribution, P(X <= x)
- dist_weibull_quantile() — Computes the quantile function (inverse CDF) of the Weibull distribution