Beta functions in the Stochastic DuckDB extension
Function category
Beta
21 functionsBeta distribution on [0,1] — shape parameters α, β. Common for Bayesian priors over probabilities and modeling proportions.
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
alpha
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
beta
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
x
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Computes the cumulative distribution function (CDF) of the beta distribution. Returns the probability that a random variable X is less than or equal to x.
SELECT dist_beta_cdf(2.0, 5.0, 0.5);
Output
| dist_beta_cdf(2.0, 5.0, 0.5) |
|---|
| 0.890625 |
Related functions
- dist_beta_sample() — Generates random samples from the beta distribution with specified parameters
- dist_beta_pdf() — Computes the probability density function (PDF) of the beta distribution
- dist_beta_quantile() — Computes the quantile function (inverse CDF) of the beta distribution
- dist_beta_mean() — Returns the mean (μ) of the beta distribution, which is the first moment
- dist_beta_stddev() — Returns the standard deviation (σ) of the beta distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
alpha
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
beta
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
x
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Computes the complementary cumulative distribution function (1 - CDF) of the beta distribution. Returns the probability that X > x, equivalent to the survival function.
SELECT dist_beta_cdf_complement(2.0, 5.0, 0.5);
Output
| dist_beta_cdf_complement(2.0, 5.0, 0.5) |
|---|
| 0.109375 |
Related functions
- dist_beta_sample() — Generates random samples from the beta distribution with specified parameters
- dist_beta_pdf() — Computes the probability density function (PDF) of the beta distribution
- dist_beta_cdf() — Computes the cumulative distribution function (CDF) of the beta distribution
- dist_beta_quantile() — Computes the quantile function (inverse CDF) of the beta distribution
- dist_beta_mean() — Returns the mean (μ) of the beta distribution, which is the first moment
- dist_beta_stddev() — Returns the standard deviation (σ) of the beta distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
alpha
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
beta
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
x
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Computes the cumulative hazard function of the beta distribution.
SELECT dist_beta_chf(2.0, 5.0, 0.5);
Output
| dist_beta_chf(2.0, 5.0, 0.5) |
|---|
| 2.2129729343043585 |
Related functions
- dist_beta_sample() — Generates random samples from the beta distribution with specified parameters
- dist_beta_pdf() — Computes the probability density function (PDF) of the beta distribution
- dist_beta_cdf() — Computes the cumulative distribution function (CDF) of the beta distribution
- dist_beta_quantile() — Computes the quantile function (inverse CDF) of the beta distribution
- dist_beta_mean() — Returns the mean (μ) of the beta distribution, which is the first moment
- dist_beta_stddev() — Returns the standard deviation (σ) of the beta distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
alpha
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
beta
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
x
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Computes the hazard function of the beta distribution.
SELECT dist_beta_hazard(2.0, 5.0, 0.5);
Output
| dist_beta_hazard(2.0, 5.0, 0.5) |
|---|
| 8.571428571428571 |
Related functions
- dist_beta_sample() — Generates random samples from the beta distribution with specified parameters
- dist_beta_pdf() — Computes the probability density function (PDF) of the beta distribution
- dist_beta_cdf() — Computes the cumulative distribution function (CDF) of the beta distribution
- dist_beta_quantile() — Computes the quantile function (inverse CDF) of the beta distribution
- dist_beta_mean() — Returns the mean (μ) of the beta distribution, which is the first moment
- dist_beta_stddev() — Returns the standard deviation (σ) of the beta distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
alpha
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
beta
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the kurtosis of the beta distribution.
SELECT dist_beta_kurtosis(2.0, 5.0);
Output
| dist_beta_kurtosis(2.0, 5.0) |
|---|
| 2.88 |
Related functions
- dist_beta_sample() — Generates random samples from the beta distribution with specified parameters
- dist_beta_pdf() — Computes the probability density function (PDF) of the beta distribution
- dist_beta_cdf() — Computes the cumulative distribution function (CDF) of the beta distribution
- dist_beta_quantile() — Computes the quantile function (inverse CDF) of the beta distribution
- dist_beta_mean() — Returns the mean (μ) of the beta distribution, which is the first moment
- dist_beta_stddev() — Returns the standard deviation (σ) of the beta distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
alpha
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
beta
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the excess kurtosis of the beta distribution.
SELECT dist_beta_kurtosis_excess(2.0, 5.0);
Output
| dist_beta_kurtosis_excess(2.0, 5.0) |
|---|
| -0.12 |
Related functions
- dist_beta_sample() — Generates random samples from the beta distribution with specified parameters
- dist_beta_pdf() — Computes the probability density function (PDF) of the beta distribution
- dist_beta_cdf() — Computes the cumulative distribution function (CDF) of the beta distribution
- dist_beta_quantile() — Computes the quantile function (inverse CDF) of the beta distribution
- dist_beta_mean() — Returns the mean (μ) of the beta distribution, which is the first moment
- dist_beta_stddev() — Returns the standard deviation (σ) of the beta distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
alpha
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
beta
|
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 beta distribution. Returns the logarithm of the probability that a random variable X is less than or equal to x.
SELECT dist_beta_log_cdf(2.0, 5.0, 0.5);
Output
| dist_beta_log_cdf(2.0, 5.0, 0.5) |
|---|
| -0.1158318155251217 |
Related functions
- dist_beta_sample() — Generates random samples from the beta distribution with specified parameters
- dist_beta_pdf() — Computes the probability density function (PDF) of the beta distribution
- dist_beta_cdf() — Computes the cumulative distribution function (CDF) of the beta distribution
- dist_beta_quantile() — Computes the quantile function (inverse CDF) of the beta distribution
- dist_beta_mean() — Returns the mean (μ) of the beta distribution, which is the first moment
- dist_beta_stddev() — Returns the standard deviation (σ) of the beta distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
alpha
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
beta
|
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 beta distribution. Returns the logarithm of the probability that X > x, equivalent to the survival function.
SELECT dist_beta_log_cdf_complement(2.0, 5.0, 0.5);
Output
| dist_beta_log_cdf_complement(2.0, 5.0, 0.5) |
|---|
| -2.2129729343043585 |
Related functions
- dist_beta_sample() — Generates random samples from the beta distribution with specified parameters
- dist_beta_pdf() — Computes the probability density function (PDF) of the beta distribution
- dist_beta_cdf() — Computes the cumulative distribution function (CDF) of the beta distribution
- dist_beta_quantile() — Computes the quantile function (inverse CDF) of the beta distribution
- dist_beta_mean() — Returns the mean (μ) of the beta distribution, which is the first moment
- dist_beta_stddev() — Returns the standard deviation (σ) of the beta distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
alpha
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
beta
|
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 beta distribution. Useful for numerical stability when dealing with very small probabilities.
SELECT dist_beta_log_pdf(2.0, 5.0, 0.5);
Output
| dist_beta_log_pdf(2.0, 5.0, 0.5) |
|---|
| -0.06453852113757129 |
Related functions
- dist_beta_sample() — Generates random samples from the beta distribution with specified parameters
- dist_beta_pdf() — Computes the probability density function (PDF) of the beta distribution
- dist_beta_cdf() — Computes the cumulative distribution function (CDF) of the beta distribution
- dist_beta_quantile() — Computes the quantile function (inverse CDF) of the beta distribution
- dist_beta_mean() — Returns the mean (μ) of the beta distribution, which is the first moment
- dist_beta_stddev() — Returns the standard deviation (σ) of the beta distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
alpha
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
beta
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the mean (μ) of the beta distribution, which is the first moment.
SELECT dist_beta_mean(2.0, 5.0);
Output
| dist_beta_mean(2.0, 5.0) |
|---|
| 0.2857142857142857 |
Related functions
- dist_beta_sample() — Generates random samples from the beta distribution with specified parameters
- dist_beta_pdf() — Computes the probability density function (PDF) of the beta distribution
- dist_beta_cdf() — Computes the cumulative distribution function (CDF) of the beta distribution
- dist_beta_quantile() — Computes the quantile function (inverse CDF) of the beta distribution
- dist_beta_stddev() — Returns the standard deviation (σ) of the beta distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
alpha
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
beta
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the median (50th percentile) of the beta distribution, which equals the mean.
SELECT dist_beta_median(2.0, 5.0);
Output
| dist_beta_median(2.0, 5.0) |
|---|
| 0.26444998329566005 |
Related functions
- dist_beta_sample() — Generates random samples from the beta distribution with specified parameters
- dist_beta_pdf() — Computes the probability density function (PDF) of the beta distribution
- dist_beta_cdf() — Computes the cumulative distribution function (CDF) of the beta distribution
- dist_beta_quantile() — Computes the quantile function (inverse CDF) of the beta distribution
- dist_beta_mean() — Returns the mean (μ) of the beta distribution, which is the first moment
- dist_beta_stddev() — Returns the standard deviation (σ) of the beta distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
alpha
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
beta
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the mode (most likely value) of the beta distribution, which equals the mean.
SELECT dist_beta_mode(2.0, 5.0);
Output
| dist_beta_mode(2.0, 5.0) |
|---|
| 0.2 |
Related functions
- dist_beta_sample() — Generates random samples from the beta distribution with specified parameters
- dist_beta_pdf() — Computes the probability density function (PDF) of the beta distribution
- dist_beta_cdf() — Computes the cumulative distribution function (CDF) of the beta distribution
- dist_beta_quantile() — Computes the quantile function (inverse CDF) of the beta distribution
- dist_beta_mean() — Returns the mean (μ) of the beta distribution, which is the first moment
- dist_beta_stddev() — Returns the standard deviation (σ) of the beta distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
alpha
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
beta
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
x
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Computes the probability density function (PDF) of the beta distribution. Returns the probability densityat point x for a beta distribution with specified parameters.
SELECT dist_beta_pdf(2.0, 5.0, 0.5);
Output
| dist_beta_pdf(2.0, 5.0, 0.5) |
|---|
| 0.9374999999999999 |
Related functions
- dist_beta_sample() — Generates random samples from the beta distribution with specified parameters
- dist_beta_cdf() — Computes the cumulative distribution function (CDF) of the beta distribution
- dist_beta_quantile() — Computes the quantile function (inverse CDF) of the beta distribution
- dist_beta_mean() — Returns the mean (μ) of the beta distribution, which is the first moment
- dist_beta_stddev() — Returns the standard deviation (σ) of the beta distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
alpha
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
beta
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
p
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Computes the quantile function (inverse CDF) of the beta distribution. Returns the value x such that P(X ≤ x) = p, where p is the cumulative probability.
SELECT dist_beta_quantile(2.0, 5.0, 0.95);
Output
| dist_beta_quantile(2.0, 5.0, 0.95) |
|---|
| 0.5818034092520259 |
Related functions
- dist_beta_sample() — Generates random samples from the beta distribution with specified parameters
- dist_beta_pdf() — Computes the probability density function (PDF) of the beta distribution
- dist_beta_cdf() — Computes the cumulative distribution function (CDF) of the beta distribution
- dist_beta_mean() — Returns the mean (μ) of the beta distribution, which is the first moment
- dist_beta_stddev() — Returns the standard deviation (σ) of the beta distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
alpha
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
beta
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
p
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Computes the complementary quantile function of the beta distribution. Returns the value x such that P(X > x) = p, useful for computing upper tail quantiles.
SELECT dist_beta_quantile_complement(2.0, 5.0, 0.05);
Output
| dist_beta_quantile_complement(2.0, 5.0, 0.05) |
|---|
| 0.5818034092520259 |
Related functions
- dist_beta_sample() — Generates random samples from the beta distribution with specified parameters
- dist_beta_pdf() — Computes the probability density function (PDF) of the beta distribution
- dist_beta_cdf() — Computes the cumulative distribution function (CDF) of the beta distribution
- dist_beta_quantile() — Computes the quantile function (inverse CDF) of the beta distribution
- dist_beta_mean() — Returns the mean (μ) of the beta distribution, which is the first moment
- dist_beta_stddev() — Returns the standard deviation (σ) of the beta distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
alpha
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
beta
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the range of the beta distribution.
SELECT dist_beta_range(2.0, 5.0);
Output
| dist_beta_range(2.0, 5.0) |
|---|
| (0.0, 1.0) |
Related functions
- dist_beta_sample() — Generates random samples from the beta distribution with specified parameters
- dist_beta_pdf() — Computes the probability density function (PDF) of the beta distribution
- dist_beta_cdf() — Computes the cumulative distribution function (CDF) of the beta distribution
- dist_beta_quantile() — Computes the quantile function (inverse CDF) of the beta distribution
- dist_beta_mean() — Returns the mean (μ) of the beta distribution, which is the first moment
- dist_beta_stddev() — Returns the standard deviation (σ) of the beta distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
alpha
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
beta
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Generates random samples from the beta distribution with specified parameters.
SELECT dist_beta_sample(2.0, 5.0);
Output
| dist_beta_sample(2.0, 5.0) |
|---|
| 0.49894986644503236 |
Related functions
- dist_beta_pdf() — Computes the probability density function (PDF) of the beta distribution
- dist_beta_cdf() — Computes the cumulative distribution function (CDF) of the beta distribution
- dist_beta_quantile() — Computes the quantile function (inverse CDF) of the beta distribution
- dist_beta_mean() — Returns the mean (μ) of the beta distribution, which is the first moment
- dist_beta_stddev() — Returns the standard deviation (σ) of the beta distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
alpha
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
beta
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the skewness of the beta distribution.
SELECT dist_beta_skewness(2.0, 5.0);
Output
| dist_beta_skewness(2.0, 5.0) |
|---|
| 0.5962847939999439 |
Related functions
- dist_beta_sample() — Generates random samples from the beta distribution with specified parameters
- dist_beta_pdf() — Computes the probability density function (PDF) of the beta distribution
- dist_beta_cdf() — Computes the cumulative distribution function (CDF) of the beta distribution
- dist_beta_quantile() — Computes the quantile function (inverse CDF) of the beta distribution
- dist_beta_mean() — Returns the mean (μ) of the beta distribution, which is the first moment
- dist_beta_stddev() — Returns the standard deviation (σ) of the beta distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
alpha
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
beta
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the standard deviation (σ) of the beta distribution.
SELECT dist_beta_stddev(2.0, 5.0);
Output
| dist_beta_stddev(2.0, 5.0) |
|---|
| 0.15971914124998499 |
Related functions
- dist_beta_sample() — Generates random samples from the beta distribution with specified parameters
- dist_beta_pdf() — Computes the probability density function (PDF) of the beta distribution
- dist_beta_cdf() — Computes the cumulative distribution function (CDF) of the beta distribution
- dist_beta_quantile() — Computes the quantile function (inverse CDF) of the beta distribution
- dist_beta_mean() — Returns the mean (μ) of the beta distribution, which is the first moment
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
alpha
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
beta
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the support of the beta distribution.
SELECT dist_beta_support(2.0, 5.0);
Output
| dist_beta_support(2.0, 5.0) |
|---|
| (0.0, 1.0) |
Related functions
- dist_beta_sample() — Generates random samples from the beta distribution with specified parameters
- dist_beta_pdf() — Computes the probability density function (PDF) of the beta distribution
- dist_beta_cdf() — Computes the cumulative distribution function (CDF) of the beta distribution
- dist_beta_quantile() — Computes the quantile function (inverse CDF) of the beta distribution
- dist_beta_mean() — Returns the mean (μ) of the beta distribution, which is the first moment
- dist_beta_stddev() — Returns the standard deviation (σ) of the beta distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
alpha
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
beta
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the variance (σ²) of the beta distribution.
SELECT dist_beta_variance(2.0, 5.0);
Output
| dist_beta_variance(2.0, 5.0) |
|---|
| 0.025510204081632654 |
Related functions
- dist_beta_sample() — Generates random samples from the beta distribution with specified parameters
- dist_beta_pdf() — Computes the probability density function (PDF) of the beta distribution
- dist_beta_cdf() — Computes the cumulative distribution function (CDF) of the beta distribution
- dist_beta_quantile() — Computes the quantile function (inverse CDF) of the beta distribution
- dist_beta_mean() — Returns the mean (μ) of the beta distribution, which is the first moment
- dist_beta_stddev() — Returns the standard deviation (σ) of the beta distribution