Bernoulli functions in the Stochastic DuckDB extension
Function category
Bernoulli
25 functionsBernoulli — single yes/no trial with success probability prob. Foundation of every binary outcome model.
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
prob
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
x
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Computes the cumulative distribution function (CDF) of the Bernoulli distribution, P(X <= x).
SELECT dist_bernoulli_cdf(0.5, 1);
Output
| dist_bernoulli_cdf(0.5, 1) |
|---|
| 1.0 |
Related functions
- dist_bernoulli_sample() — Generates a random sample from the Bernoulli distribution with the specified parameters
- dist_bernoulli_pdf() — Computes the probability mass function (PMF) of the Bernoulli distribution at x
- dist_bernoulli_quantile() — Computes the quantile function (inverse CDF) of the Bernoulli distribution
- dist_bernoulli_mean() — Returns the mean of the Bernoulli distribution
- dist_bernoulli_stddev() — Returns the standard deviation of the Bernoulli distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
prob
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
x
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Computes the complementary cumulative distribution function (survival function) of the Bernoulli distribution, P(X > x).
SELECT dist_bernoulli_cdf_complement(0.5, 1);
Output
| dist_bernoulli_cdf_complement(0.5, 1) |
|---|
| 0.0 |
Related functions
- dist_bernoulli_sample() — Generates a random sample from the Bernoulli distribution with the specified parameters
- dist_bernoulli_pdf() — Computes the probability mass function (PMF) of the Bernoulli distribution at x
- dist_bernoulli_cdf() — Computes the cumulative distribution function (CDF) of the Bernoulli distribution, P(X <= x)
- dist_bernoulli_quantile() — Computes the quantile function (inverse CDF) of the Bernoulli distribution
- dist_bernoulli_mean() — Returns the mean of the Bernoulli distribution
- dist_bernoulli_stddev() — Returns the standard deviation of the Bernoulli distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
prob
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
x
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Computes the cumulative hazard function of the Bernoulli distribution at x.
SELECT dist_bernoulli_chf(0.5, 1);
Output
| dist_bernoulli_chf(0.5, 1) |
|---|
| inf |
Related functions
- dist_bernoulli_sample() — Generates a random sample from the Bernoulli distribution with the specified parameters
- dist_bernoulli_pdf() — Computes the probability mass function (PMF) of the Bernoulli distribution at x
- dist_bernoulli_cdf() — Computes the cumulative distribution function (CDF) of the Bernoulli distribution, P(X <= x)
- dist_bernoulli_quantile() — Computes the quantile function (inverse CDF) of the Bernoulli distribution
- dist_bernoulli_mean() — Returns the mean of the Bernoulli distribution
- dist_bernoulli_stddev() — Returns the standard deviation of the Bernoulli distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
x
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Fits a Bernoulli distribution to x by maximum likelihood. Returns a STRUCT with the fitted parameters (prob) followed by the log_likelihood, aic and bic of the fit, or NULL when there are too few or only identical values.
SELECT dist_bernoulli_fit(x) AS fit
FROM (VALUES (0), (1), (1), (0), (1), (1), (1), (0), (1), (0)) t(x);
Output
| fit |
|---|
| {'prob': 0.6, 'log_likelihood': -6.730116670092564, 'aic': 15.460233340185129, 'bic': 15.762818433179174} |
Related functions
- dist_bernoulli_pdf() — Computes the probability mass function (PMF) of the Bernoulli distribution at x
- dist_bernoulli_cdf() — Computes the cumulative distribution function (CDF) of the Bernoulli distribution, P(X <= x)
- dist_bernoulli_sample() — Generates a random sample from the Bernoulli distribution with the specified parameters
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
prob
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
x
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Computes the hazard function of the Bernoulli distribution at x.
SELECT dist_bernoulli_hazard(0.5, 1);
Output
| dist_bernoulli_hazard(0.5, 1) |
|---|
| inf |
Related functions
- dist_bernoulli_sample() — Generates a random sample from the Bernoulli distribution with the specified parameters
- dist_bernoulli_pdf() — Computes the probability mass function (PMF) of the Bernoulli distribution at x
- dist_bernoulli_cdf() — Computes the cumulative distribution function (CDF) of the Bernoulli distribution, P(X <= x)
- dist_bernoulli_quantile() — Computes the quantile function (inverse CDF) of the Bernoulli distribution
- dist_bernoulli_mean() — Returns the mean of the Bernoulli distribution
- dist_bernoulli_stddev() — Returns the standard deviation of the Bernoulli distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
prob
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the kurtosis of the Bernoulli distribution. Returns NULL when it is undefined for the given parameters.
SELECT dist_bernoulli_kurtosis(0.5);
Output
| dist_bernoulli_kurtosis(0.5) |
|---|
| 1.0 |
Related functions
- dist_bernoulli_sample() — Generates a random sample from the Bernoulli distribution with the specified parameters
- dist_bernoulli_pdf() — Computes the probability mass function (PMF) of the Bernoulli distribution at x
- dist_bernoulli_cdf() — Computes the cumulative distribution function (CDF) of the Bernoulli distribution, P(X <= x)
- dist_bernoulli_quantile() — Computes the quantile function (inverse CDF) of the Bernoulli distribution
- dist_bernoulli_mean() — Returns the mean of the Bernoulli distribution
- dist_bernoulli_stddev() — Returns the standard deviation of the Bernoulli distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
prob
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the excess kurtosis of the Bernoulli distribution. Returns NULL when it is undefined for the given parameters.
SELECT dist_bernoulli_kurtosis_excess(0.5);
Output
| dist_bernoulli_kurtosis_excess(0.5) |
|---|
| -2.0 |
Related functions
- dist_bernoulli_sample() — Generates a random sample from the Bernoulli distribution with the specified parameters
- dist_bernoulli_pdf() — Computes the probability mass function (PMF) of the Bernoulli distribution at x
- dist_bernoulli_cdf() — Computes the cumulative distribution function (CDF) of the Bernoulli distribution, P(X <= x)
- dist_bernoulli_quantile() — Computes the quantile function (inverse CDF) of the Bernoulli distribution
- dist_bernoulli_mean() — Returns the mean of the Bernoulli distribution
- dist_bernoulli_stddev() — Returns the standard deviation of the Bernoulli distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
prob
|
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 Bernoulli distribution.
SELECT dist_bernoulli_log_cdf(0.5, 1);
Output
| dist_bernoulli_log_cdf(0.5, 1) |
|---|
| 0.0 |
Related functions
- dist_bernoulli_sample() — Generates a random sample from the Bernoulli distribution with the specified parameters
- dist_bernoulli_pdf() — Computes the probability mass function (PMF) of the Bernoulli distribution at x
- dist_bernoulli_cdf() — Computes the cumulative distribution function (CDF) of the Bernoulli distribution, P(X <= x)
- dist_bernoulli_quantile() — Computes the quantile function (inverse CDF) of the Bernoulli distribution
- dist_bernoulli_mean() — Returns the mean of the Bernoulli distribution
- dist_bernoulli_stddev() — Returns the standard deviation of the Bernoulli distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
prob
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
x
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Computes the natural logarithm of the survival function of the Bernoulli distribution, log P(X > x).
SELECT dist_bernoulli_log_cdf_complement(0.5, 1);
Output
| dist_bernoulli_log_cdf_complement(0.5, 1) |
|---|
| -inf |
Related functions
- dist_bernoulli_sample() — Generates a random sample from the Bernoulli distribution with the specified parameters
- dist_bernoulli_pdf() — Computes the probability mass function (PMF) of the Bernoulli distribution at x
- dist_bernoulli_cdf() — Computes the cumulative distribution function (CDF) of the Bernoulli distribution, P(X <= x)
- dist_bernoulli_quantile() — Computes the quantile function (inverse CDF) of the Bernoulli distribution
- dist_bernoulli_mean() — Returns the mean of the Bernoulli distribution
- dist_bernoulli_stddev() — Returns the standard deviation of the Bernoulli distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
prob
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
x
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Computes the natural logarithm of the probability mass function (PMF) of the Bernoulli distribution at x. Useful for numerical stability when dealing with very small probabilities.
SELECT dist_bernoulli_log_pdf(0.5, 1);
Output
| dist_bernoulli_log_pdf(0.5, 1) |
|---|
| -0.6931471805599453 |
Related functions
- dist_bernoulli_sample() — Generates a random sample from the Bernoulli distribution with the specified parameters
- dist_bernoulli_pdf() — Computes the probability mass function (PMF) of the Bernoulli distribution at x
- dist_bernoulli_cdf() — Computes the cumulative distribution function (CDF) of the Bernoulli distribution, P(X <= x)
- dist_bernoulli_quantile() — Computes the quantile function (inverse CDF) of the Bernoulli distribution
- dist_bernoulli_mean() — Returns the mean of the Bernoulli distribution
- dist_bernoulli_stddev() — Returns the standard deviation of the Bernoulli distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
prob
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
x
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Computes the natural logarithm of the probability mass function (PMF) of the Bernoulli distribution at x.
SELECT dist_bernoulli_log_pmf(0.5, 1);
Output
| dist_bernoulli_log_pmf(0.5, 1) |
|---|
| -0.6931471805599453 |
Related functions
- dist_bernoulli_sample() — Generates a random sample from the Bernoulli distribution with the specified parameters
- dist_bernoulli_pdf() — Computes the probability mass function (PMF) of the Bernoulli distribution at x
- dist_bernoulli_quantile() — Computes the quantile function (inverse CDF) of the Bernoulli distribution
- dist_bernoulli_mean() — Returns the mean of the Bernoulli distribution
- dist_bernoulli_stddev() — Returns the standard deviation of the Bernoulli distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
prob
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the mean of the Bernoulli distribution. Returns NULL when it is undefined for the given parameters.
SELECT dist_bernoulli_mean(0.5);
Output
| dist_bernoulli_mean(0.5) |
|---|
| 0.5 |
Related functions
- dist_bernoulli_sample() — Generates a random sample from the Bernoulli distribution with the specified parameters
- dist_bernoulli_pdf() — Computes the probability mass function (PMF) of the Bernoulli distribution at x
- dist_bernoulli_cdf() — Computes the cumulative distribution function (CDF) of the Bernoulli distribution, P(X <= x)
- dist_bernoulli_quantile() — Computes the quantile function (inverse CDF) of the Bernoulli distribution
- dist_bernoulli_stddev() — Returns the standard deviation of the Bernoulli distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
prob
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the median of the Bernoulli distribution. Returns NULL when it is undefined for the given parameters.
SELECT dist_bernoulli_median(0.5);
Output
| dist_bernoulli_median(0.5) |
|---|
| 0.0 |
Related functions
- dist_bernoulli_sample() — Generates a random sample from the Bernoulli distribution with the specified parameters
- dist_bernoulli_pdf() — Computes the probability mass function (PMF) of the Bernoulli distribution at x
- dist_bernoulli_cdf() — Computes the cumulative distribution function (CDF) of the Bernoulli distribution, P(X <= x)
- dist_bernoulli_quantile() — Computes the quantile function (inverse CDF) of the Bernoulli distribution
- dist_bernoulli_mean() — Returns the mean of the Bernoulli distribution
- dist_bernoulli_stddev() — Returns the standard deviation of the Bernoulli distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
prob
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the mode (most likely value) of the Bernoulli distribution. Returns NULL when it is undefined for the given parameters.
SELECT dist_bernoulli_mode(0.5);
Output
| dist_bernoulli_mode(0.5) |
|---|
| 0.0 |
Related functions
- dist_bernoulli_sample() — Generates a random sample from the Bernoulli distribution with the specified parameters
- dist_bernoulli_pdf() — Computes the probability mass function (PMF) of the Bernoulli distribution at x
- dist_bernoulli_cdf() — Computes the cumulative distribution function (CDF) of the Bernoulli distribution, P(X <= x)
- dist_bernoulli_quantile() — Computes the quantile function (inverse CDF) of the Bernoulli distribution
- dist_bernoulli_mean() — Returns the mean of the Bernoulli distribution
- dist_bernoulli_stddev() — Returns the standard deviation of the Bernoulli distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
prob
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
x
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Computes the probability mass function (PMF) of the Bernoulli distribution at x.
SELECT dist_bernoulli_pdf(0.5, 1);
Output
| dist_bernoulli_pdf(0.5, 1) |
|---|
| 0.5 |
Related functions
- dist_bernoulli_sample() — Generates a random sample from the Bernoulli distribution with the specified parameters
- dist_bernoulli_cdf() — Computes the cumulative distribution function (CDF) of the Bernoulli distribution, P(X <= x)
- dist_bernoulli_quantile() — Computes the quantile function (inverse CDF) of the Bernoulli distribution
- dist_bernoulli_mean() — Returns the mean of the Bernoulli distribution
- dist_bernoulli_stddev() — Returns the standard deviation of the Bernoulli distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
prob
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
x
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Computes the probability mass function (PMF) of the Bernoulli distribution at x, P(X = x).
SELECT dist_bernoulli_pmf(0.5, 1);
Output
| dist_bernoulli_pmf(0.5, 1) |
|---|
| 0.5 |
Related functions
- dist_bernoulli_sample() — Generates a random sample from the Bernoulli distribution with the specified parameters
- dist_bernoulli_pdf() — Computes the probability mass function (PMF) of the Bernoulli distribution at x
- dist_bernoulli_quantile() — Computes the quantile function (inverse CDF) of the Bernoulli distribution
- dist_bernoulli_mean() — Returns the mean of the Bernoulli distribution
- dist_bernoulli_stddev() — Returns the standard deviation of the Bernoulli distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
prob
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
p
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Computes the quantile function (inverse CDF) of the Bernoulli distribution. Returns the smallest x such that P(X <= x) >= p.
SELECT dist_bernoulli_quantile(0.5, 0.95);
Output
| dist_bernoulli_quantile(0.5, 0.95) |
|---|
| 1.0 |
Related functions
- dist_bernoulli_sample() — Generates a random sample from the Bernoulli distribution with the specified parameters
- dist_bernoulli_pdf() — Computes the probability mass function (PMF) of the Bernoulli distribution at x
- dist_bernoulli_cdf() — Computes the cumulative distribution function (CDF) of the Bernoulli distribution, P(X <= x)
- dist_bernoulli_mean() — Returns the mean of the Bernoulli distribution
- dist_bernoulli_stddev() — Returns the standard deviation of the Bernoulli distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
prob
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
p
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Computes the complementary quantile function of the Bernoulli distribution. Returns x such that P(X > x) = p, useful for upper tail quantiles.
SELECT dist_bernoulli_quantile_complement(0.5, 0.95);
Output
| dist_bernoulli_quantile_complement(0.5, 0.95) |
|---|
| 0.0 |
Related functions
- dist_bernoulli_sample() — Generates a random sample from the Bernoulli distribution with the specified parameters
- dist_bernoulli_pdf() — Computes the probability mass function (PMF) of the Bernoulli distribution at x
- dist_bernoulli_cdf() — Computes the cumulative distribution function (CDF) of the Bernoulli distribution, P(X <= x)
- dist_bernoulli_quantile() — Computes the quantile function (inverse CDF) of the Bernoulli distribution
- dist_bernoulli_mean() — Returns the mean of the Bernoulli distribution
- dist_bernoulli_stddev() — Returns the standard deviation of the Bernoulli distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
prob
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the range of the Bernoulli distribution as [min, max].
SELECT dist_bernoulli_range(0.5);
Output
| dist_bernoulli_range(0.5) |
|---|
| [0.0, 1.0] |
Related functions
- dist_bernoulli_sample() — Generates a random sample from the Bernoulli distribution with the specified parameters
- dist_bernoulli_pdf() — Computes the probability mass function (PMF) of the Bernoulli distribution at x
- dist_bernoulli_cdf() — Computes the cumulative distribution function (CDF) of the Bernoulli distribution, P(X <= x)
- dist_bernoulli_quantile() — Computes the quantile function (inverse CDF) of the Bernoulli distribution
- dist_bernoulli_mean() — Returns the mean of the Bernoulli distribution
- dist_bernoulli_stddev() — Returns the standard deviation of the Bernoulli distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
prob
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Generates a random sample from the Bernoulli distribution with the specified parameters.
SELECT dist_bernoulli_sample(0.5);
Output
| dist_bernoulli_sample(0.5) |
|---|
| true |
Related functions
- dist_bernoulli_pdf() — Computes the probability mass function (PMF) of the Bernoulli distribution at x
- dist_bernoulli_cdf() — Computes the cumulative distribution function (CDF) of the Bernoulli distribution, P(X <= x)
- dist_bernoulli_quantile() — Computes the quantile function (inverse CDF) of the Bernoulli distribution
- dist_bernoulli_mean() — Returns the mean of the Bernoulli distribution
- dist_bernoulli_stddev() — Returns the standard deviation of the Bernoulli distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
prob
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
n
|
Type
BIGINT
|
Mode Positional | Description |
Description
Generates a list of n random samples from the Bernoulli distribution with the specified parameters.
SELECT dist_bernoulli_samples(0.5, 5);
Output
| dist_bernoulli_samples(0.5, 5) |
|---|
| [True, False, True, False, False] |
Related functions
- dist_bernoulli_sample() — Generates a random sample from the Bernoulli distribution with the specified parameters
- dist_bernoulli_pdf() — Computes the probability mass function (PMF) of the Bernoulli distribution at x
- dist_bernoulli_quantile() — Computes the quantile function (inverse CDF) of the Bernoulli distribution
- dist_bernoulli_mean() — Returns the mean of the Bernoulli distribution
- dist_bernoulli_stddev() — Returns the standard deviation of the Bernoulli distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
prob
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the skewness of the Bernoulli distribution. Returns NULL when it is undefined for the given parameters.
SELECT dist_bernoulli_skewness(0.5);
Output
| dist_bernoulli_skewness(0.5) |
|---|
| 0.0 |
Related functions
- dist_bernoulli_sample() — Generates a random sample from the Bernoulli distribution with the specified parameters
- dist_bernoulli_pdf() — Computes the probability mass function (PMF) of the Bernoulli distribution at x
- dist_bernoulli_cdf() — Computes the cumulative distribution function (CDF) of the Bernoulli distribution, P(X <= x)
- dist_bernoulli_quantile() — Computes the quantile function (inverse CDF) of the Bernoulli distribution
- dist_bernoulli_mean() — Returns the mean of the Bernoulli distribution
- dist_bernoulli_stddev() — Returns the standard deviation of the Bernoulli distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
prob
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the standard deviation of the Bernoulli distribution. Returns NULL when it is undefined for the given parameters.
SELECT dist_bernoulli_stddev(0.5);
Output
| dist_bernoulli_stddev(0.5) |
|---|
| 0.5 |
Related functions
- dist_bernoulli_sample() — Generates a random sample from the Bernoulli distribution with the specified parameters
- dist_bernoulli_pdf() — Computes the probability mass function (PMF) of the Bernoulli distribution at x
- dist_bernoulli_cdf() — Computes the cumulative distribution function (CDF) of the Bernoulli distribution, P(X <= x)
- dist_bernoulli_quantile() — Computes the quantile function (inverse CDF) of the Bernoulli distribution
- dist_bernoulli_mean() — Returns the mean of the Bernoulli distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
prob
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the support of the Bernoulli distribution as [min, max].
SELECT dist_bernoulli_support(0.5);
Output
| dist_bernoulli_support(0.5) |
|---|
| [0.0, 1.0] |
Related functions
- dist_bernoulli_sample() — Generates a random sample from the Bernoulli distribution with the specified parameters
- dist_bernoulli_pdf() — Computes the probability mass function (PMF) of the Bernoulli distribution at x
- dist_bernoulli_cdf() — Computes the cumulative distribution function (CDF) of the Bernoulli distribution, P(X <= x)
- dist_bernoulli_quantile() — Computes the quantile function (inverse CDF) of the Bernoulli distribution
- dist_bernoulli_mean() — Returns the mean of the Bernoulli distribution
- dist_bernoulli_stddev() — Returns the standard deviation of the Bernoulli distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
prob
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the variance of the Bernoulli distribution. Returns NULL when it is undefined for the given parameters.
SELECT dist_bernoulli_variance(0.5);
Output
| dist_bernoulli_variance(0.5) |
|---|
| 0.25 |
Related functions
- dist_bernoulli_sample() — Generates a random sample from the Bernoulli distribution with the specified parameters
- dist_bernoulli_pdf() — Computes the probability mass function (PMF) of the Bernoulli distribution at x
- dist_bernoulli_cdf() — Computes the cumulative distribution function (CDF) of the Bernoulli distribution, P(X <= x)
- dist_bernoulli_quantile() — Computes the quantile function (inverse CDF) of the Bernoulli distribution
- dist_bernoulli_mean() — Returns the mean of the Bernoulli distribution
- dist_bernoulli_stddev() — Returns the standard deviation of the Bernoulli distribution