DuckDB Extension
Stochastic
Evaluate probability distributions in DuckDB SQL. Compute densities, cumulative probabilities and quantiles, generate samples for simulations, fit distributions to data and run hypothesis tests.
On this page
Calculate probabilities and draw samples in SQL
Stochastic provides 36 probability distributions through a consistent set of SQL functions. For each one you can evaluate a density, calculate a cumulative probability or quantile, read its properties and generate random samples.
It also works in the other direction: fit aggregates estimate a distribution's parameters from a column by maximum likelihood, and test aggregates run Kolmogorov-Smirnov, t-tests and Pearson's chi-squared test next to your data. Use it for synthetic datasets, probability calculations alongside existing rows, simulation experiments and quick inference.
Example
Find a normal-distribution percentile
Calculate the 95th percentile of a standard normal distribution, then check its cumulative probability.
Tested with DuckDB 2.0.0. Browser examples use Haybarn-Wasm 2.0.0-rc12.
SET allow_extension_repositories = 'allowed';
CREATE EXTENSION REPOSITORY IF NOT EXISTS query_farm
WITH PREFIX 'https://duckdb-extensions.query.farm';
INSTALL stochastic FROM query_farm;
LOAD stochastic FROM query_farm;
SELECT round(dist_normal_quantile(0.0, 1.0, 0.95), 4) AS p95,
round(dist_normal_cdf(0.0, 1.0, 1.6448536269514722), 2) AS probability;
SET allow_extension_repositories = 'allowed';
CREATE EXTENSION REPOSITORY IF NOT EXISTS query_farm
WITH PREFIX 'https://haybarn-extensions.query.farm';
INSTALL stochastic FROM query_farm;
LOAD stochastic FROM query_farm;
SELECT round(dist_normal_quantile(0.0, 1.0, 0.95), 4) AS p95,
round(dist_normal_cdf(0.0, 1.0, 1.6448536269514722), 2) AS probability;
INSTALL stochastic FROM community;
LOAD stochastic;
SELECT round(dist_normal_quantile(0.0, 1.0, 0.95), 4) AS p95,
round(dist_normal_cdf(0.0, 1.0, 1.6448536269514722), 2) AS probability;
Expected result
| p95 | probability |
|---|---|
| 1.6449 | 0.95 |
The parameters describe a standard normal distribution: mean 0 and standard deviation 1. This computes a theoretical quantile, not a percentile of an observed table.
Example
Fit a distribution and test the fit
Fit a gamma distribution to a column by maximum likelihood, then check the fit with a Kolmogorov-Smirnov test.
Tested with DuckDB 2.0.0. Run this example in the DuckDB CLI or a native client.
SET allow_extension_repositories = 'allowed';
CREATE EXTENSION REPOSITORY IF NOT EXISTS query_farm
WITH PREFIX 'https://duckdb-extensions.query.farm';
INSTALL stochastic FROM query_farm;
LOAD stochastic FROM query_farm;
WITH durations AS (
SELECT * FROM (VALUES (1.2), (0.7), (2.9), (1.8), (0.4), (3.6), (1.1), (2.2)) t(x)
), fit AS (
SELECT dist_gamma_fit(x) AS f FROM durations
)
SELECT round(f.shape, 4) AS shape, round(f.scale, 4) AS scale,
round(dist_gamma_ks_test(x, f.shape, f.scale).p_value, 4) AS ks_p_value
FROM durations, fit
GROUP BY f;
SET allow_extension_repositories = 'allowed';
CREATE EXTENSION REPOSITORY IF NOT EXISTS query_farm
WITH PREFIX 'https://haybarn-extensions.query.farm';
INSTALL stochastic FROM query_farm;
LOAD stochastic FROM query_farm;
WITH durations AS (
SELECT * FROM (VALUES (1.2), (0.7), (2.9), (1.8), (0.4), (3.6), (1.1), (2.2)) t(x)
), fit AS (
SELECT dist_gamma_fit(x) AS f FROM durations
)
SELECT round(f.shape, 4) AS shape, round(f.scale, 4) AS scale,
round(dist_gamma_ks_test(x, f.shape, f.scale).p_value, 4) AS ks_p_value
FROM durations, fit
GROUP BY f;
INSTALL stochastic FROM community;
LOAD stochastic;
WITH durations AS (
SELECT * FROM (VALUES (1.2), (0.7), (2.9), (1.8), (0.4), (3.6), (1.1), (2.2)) t(x)
), fit AS (
SELECT dist_gamma_fit(x) AS f FROM durations
)
SELECT round(f.shape, 4) AS shape, round(f.scale, 4) AS scale,
round(dist_gamma_ks_test(x, f.shape, f.scale).p_value, 4) AS ks_p_value
FROM durations, fit
GROUP BY f;
Expected result
| shape | scale | ks_p_value |
|---|---|---|
| 2.5168 | 0.6904 | 0.9991 |
The fit returns a STRUCT whose fields are named like the distribution's parameters, so it plugs straight into the other dist_gamma_* functions, followed by the log_likelihood, aic and bic for comparing fits. Fitting and the tests need the DuckDB 2.0 build of the extension.
Common tasks
- Choose a distribution Match the family to the quantity you are modelling.
- Fit a distribution to data Estimate parameters from a column, then test the fit.
- Run a hypothesis test t-tests, chi-squared and Kolmogorov-Smirnov as aggregates.
- Generate synthetic columns Sample from several distribution families.
- Make sampling reproducible Seed sampling with setseed.
Deep Dive
Technical Details
What you can do with one query
Estimate π with a million-draw Monte Carlo — entirely inside DuckDB, no Python, no NumPy:
WITH samples AS ( SELECT dist_uniform_real_sample(-1.0, 1.0) AS x, dist_uniform_real_sample(-1.0, 1.0) AS y FROM range(1000000))SELECT 4.0 * COUNT(*) FILTER (WHERE x*x + y*y <= 1) / COUNT(*) AS pi_estimateFROM samples;The same shape — generate, filter, aggregate — handles portfolio VaR, payoff integration, queueing simulation, or generating a million-row synthetic dataset for a load test. Every dist_<family>_sample is a vectorized scalar function, so a million draws is one columnar scan.
Going the other way — from data to a distribution — is one aggregate:
SELECT dist_normal_fit(x) AS fit, dist_normal_ks_test(x, 0.0, 1.0).p_value AS standard_normal_pFROM (SELECT dist_normal_sample(0.0, 1.0) AS x FROM range(10000));This extension is a statistical-distributions library, not a full simulation or modeling framework. It covers 36 common distributions with the full PDF / CDF / quantile / hazard / sampling / properties surface — built on the Boost.Math distributions library — plus maximum likelihood fits for 11 of them and the everyday hypothesis tests.
What it deliberately doesn’t ship:
- No copulas or multivariate Normal. Dirichlet and multinomial are the only multivariate distributions; correlated Normal draws need a Cholesky-style transform you write yourself.
- No regression or model fitting. Fits estimate one distribution’s parameters from one column.
For production-grade simulation, MCMC, or anything needing SciPy-level modeling, keep a Python notebook with NumPy and SciPy. For quick analysis, what-if exploration, inference and synthetic data right next to your warehouse data, this is the right tool.
What this extension covers
36 named probability distributions — 28 continuous and 8 discrete, including the multivariate Dirichlet and multinomial. Every univariate distribution exposes the same set of operations:
- Sampling (
_sample,_samples) — draw a random value, or a list ofnvalues. - Density / mass (
_pdf,_log_pdf; discrete distributions also have_pmf,_log_pmf) — point density or probability. - Cumulative (
_cdf,_log_cdf,_cdf_complement,_log_cdf_complement) — left tail and survival. - Quantile (
_quantile,_quantile_complement) — inverse CDF. - Hazard (
_hazard,_chf) — instantaneous and cumulative hazard. - Properties (
_mean,_median,_mode,_variance,_stddev,_skewness,_kurtosis,_kurtosis_excess,_range,_support). - Kolmogorov-Smirnov test (
_ks_test, continuous distributions) — aggregate goodness-of-fit test against given parameters.
The same naming scheme across every distribution means once you know one distribution’s surface you know them all. Browse the categories sidebar to jump straight to the distribution you need. The Fitting and Hypothesis Tests categories list the aggregates.
Why DuckDB instead of Python / R / Excel?
- No data movement. Stats happen where the rows live — no export to NumPy or pandas just to compute a CDF or fit a column.
- Vectorized. All functions run column-at-a-time over DuckDB’s columnar engine.
- SQL composition. Probability calculations chain cleanly with joins, window functions, CTEs, and CTAS; fits and tests work per
GROUP BYgroup. - Reproducibility. A
WITHclause containing distribution functions is a complete, self-describing analysis you can paste into any DuckDB session, andsetseedmakes its samples repeatable.
Parameter validation
Every function validates its parameters and raises a SQL error on illegal inputs — no silent NaN propagation. Errors name the distribution and the parameter:
-- expect-error: normal: stddev must be > 0, got -1SELECT dist_normal_pdf(0.0, -1.0, 0.5);
-- expect-error: binomial: prob must be between 0 and 1, got 1.5SELECT dist_binomial_pdf(10, 1.5, 5);
-- expect-error: normal: Probability argument is 1.5, but must be >= 0 and <= 1SELECT dist_normal_quantile(0.0, 1.0, 1.5);NaN and infinite parameters are rejected the same way. Evaluation points may be infinite, and the quantile at p = 0 or 1 is the lower or upper end of the support (-inf or inf when it is unbounded).
Outside the support, and at an infinite x, the density and cumulative functions return their limits instead of raising an error: the PDF or PMF is 0, the CDF is 0 below the support and 1 above it, and the hazard is 0 below it (above it the hazard is undefined and raises an error). Discrete distributions only take whole numbers, so their PMF is 0 between them and their CDF steps at each integer:
SELECT dist_beta_pdf(2.0, 5.0, 1.5) AS above_support, dist_exponential_cdf(1.0, -1.0) AS below_support, dist_poisson_pmf(5.0, 2.5) AS between_integers, dist_poisson_cdf(5.0, 2.5) = dist_poisson_cdf(5.0, 2) AS step;_support and _range report an unbounded end as inf.
Results are checked too. A calculation that breaks down numerically at extreme parameters — one that would return NaN, or a probability outside [0, 1] — raises an error such as rayleigh: the result is not a number for these arguments instead of returning a wrong value:
SELECT dist_normal_quantile(0.0, 1.0, 1.0) AS upper, dist_normal_cdf(0.0, 1.0, '-inf'::DOUBLE) AS lower_tail;Undefined properties return NULL
Some moments do not exist for some parameters — the Cauchy distribution has no mean or variance, and Student’s t has no variance for df ≤ 2. Those calls return NULL instead of raising an error:
SELECT dist_cauchy_mean(0.0, 1.0) AS cauchy_mean, dist_cauchy_median(0.0, 1.0) AS cauchy_median, dist_students_t_variance(1.5) AS t_variance_df_1_5;Discrete quantiles
Quantiles of discrete distributions are integers: the smallest x with P(X <= x) >= p, the same definition R uses for qpois and qbinom.
SELECT dist_poisson_quantile(5.0, 0.3) AS q30, dist_binomial_quantile(10, 0.5, 0.2) AS q20, dist_geometric_quantile(0.5, 0.95) AS q95;The binomial, negative binomial, hypergeometric and integer uniform quantiles return BIGINT; the others return a whole-number DOUBLE. A BIGINT quantile that would be infinite — such as the negative binomial quantile at p = 1 — raises an error.
Samplers for discrete distributions reject parameters whose samples could exceed 2^53, the range where DOUBLE represents every integer exactly. For example, dist_poisson_sample(1e300) is an error rather than a hang. Discrete quantiles and medians above 2^53 are rejected for the same reason.
Non-central parameter limits
The non-central chi-squared, F and beta distributions accept a noncentrality up to 10^8, and the non-central t up to 1,000 in absolute value. Beyond those limits the underlying series converge too slowly or not at all, so the functions raise an error instead of running for minutes. Power calculations sit far inside them.
Fit reference
dist_<name>_fit(x) is an aggregate that estimates a distribution’s parameters by maximum likelihood. It returns a STRUCT whose first fields are named like the distribution’s parameters, so the result plugs straight back into the other functions. Every fit also returns:
log_likelihood— the log-likelihood of the sample at the fitted parametersaic— the Akaike information criterion,2k - 2 log Lforkestimated parametersbic— the Bayesian information criterion,k ln(n) - 2 log L
Lower AIC and BIC mean a better fit, so they compare candidate distributions on the same column.
dist_fits does that comparison for you. It runs several fits over one sample and returns a list with one entry per candidate, best first: the distribution, its fitted parameters as a MAP, log_likelihood, aic, aicc, bic, delta_aicc (the difference from the best AICc), aicc_weight (the Akaike weight among the ranked candidates) and a note. Candidates that can’t be ranked, because values fall outside their support, there are too few values or the fit fails, come last with the reason in note. Without a candidate list it tries the 14 continuous fits normal, lognormal, exponential, rayleigh, gamma, inverse_gamma, chi_squared, inverse_gaussian, beta, laplace, logistic, cauchy, extreme_value and weibull.
| Fit | Parameters |
|---|---|
dist_normal_fit |
{mean, stddev} |
dist_lognormal_fit |
{mean, stddev} of ln(x) |
dist_exponential_fit |
{rate} |
dist_poisson_fit |
{rate} |
dist_bernoulli_fit |
{prob} (x is 0 or 1) |
dist_geometric_fit |
{prob} (x counts failures before the first success) |
dist_binomial_fit(x, trials) |
{prob} for a known number of trials |
dist_negative_binomial_fit |
{successes, prob}, with a whole number of successes |
dist_rayleigh_fit |
{scale} |
dist_uniform_real_fit |
{min, max} |
dist_pareto_fit |
{scale, shape} |
dist_gamma_fit |
{shape, scale} |
dist_inverse_gamma_fit |
{shape, scale} |
dist_chi_squared_fit |
{degrees_of_freedom} |
dist_inverse_gaussian_fit |
{mean, shape} |
dist_beta_fit |
{alpha, beta} |
dist_weibull_fit |
{shape, scale} |
dist_laplace_fit |
{location, scale} (the median and the mean absolute deviation from it) |
dist_logistic_fit |
{location, scale} |
dist_cauchy_fit |
{location, scale} |
dist_extreme_value_fit |
{location, scale} (Gumbel) |
dist_students_t_fit |
{degrees_of_freedom} of the standard Student’s t |
NULL inputs are ignored. An empty sample, or one whose values are all the same, returns NULL. Values outside the distribution’s support raise an error — a negative value for gamma, or 1 for beta. The normal and log-normal fits return the maximum likelihood standard deviation, which divides by n, not n - 1.
A few fits have their own rules:
- The binomial fit takes the known number of trials as its second argument, which must be the same for every row of a group.
- The negative binomial fit restricts
successesto a whole number, as the distribution functions require; cast it toBIGINTto pass it on. A sample whose variance does not exceed its mean has no negative binomial fit and returns NULL. - The Student’s t fit returns NULL when the tails are no heavier than normal, where the degrees of freedom grow without bound.
- The Weibull, Laplace, logistic, Cauchy, extreme value, Student’s t and negative binomial fits have no fixed-size summary statistics, so they hold the group’s values in memory. The others keep a few running sums.
- A fit that overflows because the values are extremely large or small in magnitude (around 1e±300) raises an error rather than returning NaN.
Hypothesis test reference
Each test is an aggregate that returns a STRUCT with the statistic, the degrees of freedom and the p-value:
| Test | Arguments | Returns |
|---|---|---|
dist_<name>_ks_test |
x and the distribution’s parameters |
{statistic, p_value} |
welch_t_test |
x, sample_index (0 or 1) |
{t_statistic, degrees_of_freedom, p_value} |
student_t_test |
x, sample_index (0 or 1) |
{t_statistic, degrees_of_freedom, p_value} |
one_sample_t_test |
x, mu |
{t_statistic, degrees_of_freedom, p_value} |
chi_squared_test |
observed, expected (one row per category) |
{statistic, degrees_of_freedom, p_value} |
The t-test p-values are two-sided. The Kolmogorov-Smirnov p-value uses the asymptotic distribution of √n·D, which is approximate for small samples, and the distribution parameters must be the same for every row of a group. chi_squared_test rescales the expected values to the observed total, so they can be counts or probabilities.
SELECT welch_t_test(x, grp) AS welch, student_t_test(x, grp).p_value AS pooled_pFROM (VALUES (5.1, 0), (4.8, 0), (5.6, 0), (5.0, 0), (6.2, 1), (5.9, 1), (7.1, 1), (6.4, 1)) t(x, grp);Seeding with setseed
Sampling uses DuckDB’s per-connection random engine, so setseed makes the samples that follow it reproducible — including when the query runs on many threads:
SELECT setseed(0.42);SELECT sum(dist_normal_sample(0.0, 1.0)) AS total FROM range(100000);Run the pair again and the total is identical.
When to use which family
| Pick this when… | Reach for |
|---|---|
| Test scores, measurement noise, anything CLT-flavoured | Normal |
| Bell-shaped but skewed measurements | Skew Normal |
| Small-sample inference (df ≤ 30) | Student’s t |
| Counts of independent events at a rate | Poisson |
| Yes/no per-trial outcomes | Bernoulli, Binomial |
| Draws without replacement from a finite population | Hypergeometric |
| Counts across several categories | Multinomial |
| Time between events / time-to-failure | Exponential, Weibull, Inverse Gaussian |
| Heavy-tailed wealth or file-size data | Pareto, Cauchy, Log-normal |
| Bayesian priors over probabilities | Beta, Dirichlet |
| Bayesian priors over a variance | Inverse Gamma, Inverse Chi-squared |
| Estimates from a minimum, most likely and maximum | Triangular |
| Ratios of variances (ANOVA / regression) | Fisher F |
| Goodness-of-fit, variance tests | Chi-squared, Kolmogorov-Smirnov |
| Power and sample-size calculations | Non-central t, Non-central F, Non-central Chi-squared, Non-central Beta |
| Block maxima / rare-event tails | Extreme Value |
| Robust regression / sparse priors | Laplace |
| Random walks, values concentrated at both ends | Arcsine |
| Inverse-transform sampling, dice, random index | Uniform (Real), Uniform (Integer) |
Changes in the DuckDB 2.0 build
The DuckDB 2.0 build of the extension adds:
- 14 distributions: arcsine, hypergeometric, inverse gamma, scaled inverse chi-squared, inverse Gaussian, Kolmogorov-Smirnov, non-central beta / chi-squared / F / t, skew normal, triangular, Dirichlet and multinomial.
- Fit aggregates for 22 distributions, each reporting the log-likelihood, AIC and BIC, and the hypothesis test aggregates above.
_samples(a list ofnsamples) for every univariate distribution, and_pmf/_log_pmffor discrete ones.- Function categories in
duckdb_functions():[statistics, <kind>, <distribution>].
It also changes behavior:
- Errors name the distribution and parameter. Out-of-range probabilities no longer surface as raw Boost.Math errors, and quantiles at p = 0 or 1 return
±infinstead of an overflow error. - Undefined properties return NULL. Properties that were missing before — such as the binomial and negative binomial mean and standard deviation — are now available.
- Discrete quantiles use the smallest-x definition above.
dist_poisson_quantile(5, 0.3)is now 4 (it was 3), anddist_geometric_quantile(0.5, 0.95)is now 4 (it was 3.32). - The gamma parameters are named
shape, scale, and the extreme value and logistic location parameters are namedlocation. Arguments are positional, so queries are unaffected. - Results that break down numerically at extreme parameters raise an error instead of returning NaN or an out-of-range probability, and the non-central distributions have the parameter limits above.
- Points outside the support return the limits described under parameter validation instead of an error, discrete PMFs are 0 at non-integers (they were interpolated),
_supportand_rangereport unbounded ends asinf(they were1.7976931348623157e+308), and the skew normal and inverse Gaussian quantiles at p = 0 and 1 return the ends of the support (build 2026110701 and later). - Continuous CDFs and quantiles are faster on Linux ARM64: calculations stay in
DOUBLE, which also makes results the same on every platform.
Integer uniform and Pareto compatibility
The October 7, 2026 v1.5 source fix makes the uniform_int analytical functions agree with integer sampling on the inclusive interval [min, max]. The DuckDB 2.0 build includes it. Earlier builds, including 234c881, used continuous-uniform formulas and truncated several moments.
SELECT dist_uniform_int_pdf(1, 6, 3) AS mass, dist_uniform_int_cdf(1, 6, 3) AS cumulative, dist_uniform_int_mean(1, 6) AS mean, dist_uniform_int_variance(1, 6) AS variance;-- Corrected: 1/6, 0.5, 3.5, 35/12-- Older affected builds: 0.2, 0.4, 3, 2In corrected builds, mean, variance, standard deviation, and median return DOUBLE; sample, quantile, and mode remain BIGINT. The median is the midpoint; the quantile is the smallest supported integer whose mathematical CDF reaches the exact binary DOUBLE probability. There is no boundary tolerance: for example, 0.1::DOUBLE is slightly greater than one tenth, so dist_uniform_int_quantile(1, 10, 0.1) returns 2. Every supported integer is a mode, and _mode returns min as a representative. The discrete hazard is P(X = x) / P(X >= x), so it equals 1 at max; above max it raises an error.
Bounds retain their DOUBLE SQL signature but must be finite integers representable by BIGINT, with min <= max. Values outside the exact integer precision of DOUBLE are subject to argument rounding; use smaller bounds when exact integer endpoints matter. Equal bounds define a constant draw with zero variance; standardized moments (skewness and kurtosis) are undefined and raise errors.
Pareto positional arguments remain (scale, shape), with the minimum supported value equal to scale. The fix corrects older catalog labels [shape, minimum] without reordering SQL arguments. For example, dist_pareto_mean(1, 3) is 1.5. Both parameters must be positive and finite.
Reference
Extension Contents
Quick reference to all available functions and settings organized by category.
| Name | Type | Description |
|---|---|---|
|
Arcsine
Arcsine distribution on [min, max] — U-shaped density with most mass near the ends. Random walks and the time a walk spends positive. |
||
| dist_arcsine_cdf() | Object type: Scalar function | Computes the cumulative distribution function (CDF) of the arcsine distribution, P(X <= x). |
| dist_arcsine_cdf_complement() | Object type: Scalar function | Computes the complementary cumulative distribution function (survival function) of the arcsine distribution, P(X > x). |
| dist_arcsine_chf() | Object type: Scalar function | Computes the cumulative hazard function of the arcsine distribution at x. |
| dist_arcsine_hazard() | Object type: Scalar function | Computes the hazard function of the arcsine distribution at x. |
| dist_arcsine_ks_test() | Object type: Aggregate function | One-sample Kolmogorov-Smirnov test of whether x follows the arcsine distribution with the given parameters. |
| dist_arcsine_kurtosis() | Object type: Scalar function | Returns the kurtosis of the arcsine distribution. |
| dist_arcsine_kurtosis_excess() | Object type: Scalar function | Returns the excess kurtosis of the arcsine distribution. |
| dist_arcsine_log_cdf() | Object type: Scalar function | Computes the natural logarithm of the cumulative distribution function (CDF) of the arcsine distribution. |
| dist_arcsine_log_cdf_complement() | Object type: Scalar function | Computes the natural logarithm of the survival function of the arcsine distribution, log P(X > x). |
| dist_arcsine_log_pdf() | Object type: Scalar function | Computes the natural logarithm of the probability density function (PDF) of the arcsine distribution at x. |
| dist_arcsine_mean() | Object type: Scalar function | Returns the mean of the arcsine distribution. |
| dist_arcsine_median() | Object type: Scalar function | Returns the median of the arcsine distribution. |
| dist_arcsine_mode() | Object type: Scalar function | Returns the mode (most likely value) of the arcsine distribution. |
| dist_arcsine_pdf() | Object type: Scalar function | Computes the probability density function (PDF) of the arcsine distribution at x. |
| dist_arcsine_quantile() | Object type: Scalar function | Computes the quantile function (inverse CDF) of the arcsine distribution. |
| dist_arcsine_quantile_complement() | Object type: Scalar function | Computes the complementary quantile function of the arcsine distribution. |
| dist_arcsine_range() | Object type: Scalar function | Returns the range of the arcsine distribution as [min, max]. |
| dist_arcsine_sample() | Object type: Scalar function | Generates a random sample from the arcsine distribution with the specified parameters. |
| dist_arcsine_samples() | Object type: Scalar function | Generates a list of n random samples from the arcsine distribution with the specified parameters. |
| dist_arcsine_skewness() | Object type: Scalar function | Returns the skewness of the arcsine distribution. |
| dist_arcsine_stddev() | Object type: Scalar function | Returns the standard deviation of the arcsine distribution. |
| dist_arcsine_support() | Object type: Scalar function | Returns the support of the arcsine distribution as [min, max]. |
| dist_arcsine_variance() | Object type: Scalar function | Returns the variance of the arcsine distribution. |
|
Bernoulli
Bernoulli — single yes/no trial with success probability |
||
| dist_bernoulli_cdf() | Object type: Scalar function | Computes the cumulative distribution function (CDF) of the Bernoulli distribution, P(X <= x). |
| dist_bernoulli_cdf_complement() | Object type: Scalar function | Computes the complementary cumulative distribution function (survival function) of the Bernoulli distribution, P(X > x). |
| dist_bernoulli_chf() | Object type: Scalar function | Computes the cumulative hazard function of the Bernoulli distribution at x. |
| dist_bernoulli_fit() | Object type: Aggregate function | Fits a Bernoulli distribution to x by maximum likelihood. |
| dist_bernoulli_hazard() | Object type: Scalar function | Computes the hazard function of the Bernoulli distribution at x. |
| dist_bernoulli_kurtosis() | Object type: Scalar function | Returns the kurtosis of the Bernoulli distribution. |
| dist_bernoulli_kurtosis_excess() | Object type: Scalar function | Returns the excess kurtosis of the Bernoulli distribution. |
| dist_bernoulli_log_cdf() | Object type: Scalar function | Computes the natural logarithm of the cumulative distribution function (CDF) of the Bernoulli distribution. |
| dist_bernoulli_log_cdf_complement() | Object type: Scalar function | Computes the natural logarithm of the survival function of the Bernoulli distribution, log P(X > x). |
| dist_bernoulli_log_pdf() | Object type: Scalar function | Computes the natural logarithm of the probability mass function (PMF) of the Bernoulli distribution at x. |
| dist_bernoulli_log_pmf() | Object type: Scalar function | Computes the natural logarithm of the probability mass function (PMF) of the Bernoulli distribution at x. |
| dist_bernoulli_mean() | Object type: Scalar function | Returns the mean of the Bernoulli distribution. |
| dist_bernoulli_median() | Object type: Scalar function | Returns the median of the Bernoulli distribution. |
| dist_bernoulli_mode() | Object type: Scalar function | Returns the mode (most likely value) of the Bernoulli distribution. |
| dist_bernoulli_pdf() | Object type: Scalar function | Computes the probability mass function (PMF) of the Bernoulli distribution at x. |
| dist_bernoulli_pmf() | Object type: Scalar function | Computes the probability mass function (PMF) of the Bernoulli distribution at x, P(X = x). |
| dist_bernoulli_quantile() | Object type: Scalar function | Computes the quantile function (inverse CDF) of the Bernoulli distribution. |
| dist_bernoulli_quantile_complement() | Object type: Scalar function | Computes the complementary quantile function of the Bernoulli distribution. |
| dist_bernoulli_range() | Object type: Scalar function | Returns the range of the Bernoulli distribution as [min, max]. |
| dist_bernoulli_sample() | Object type: Scalar function | Generates a random sample from the Bernoulli distribution with the specified parameters. |
| dist_bernoulli_samples() | Object type: Scalar function | Generates a list of n random samples from the Bernoulli distribution with the specified parameters. |
| dist_bernoulli_skewness() | Object type: Scalar function | Returns the skewness of the Bernoulli distribution. |
| dist_bernoulli_stddev() | Object type: Scalar function | Returns the standard deviation of the Bernoulli distribution. |
| dist_bernoulli_support() | Object type: Scalar function | Returns the support of the Bernoulli distribution as [min, max]. |
| dist_bernoulli_variance() | Object type: Scalar function | Returns the variance of the Bernoulli distribution. |
|
Beta
Beta distribution on [0,1] — shape parameters α, β. Common for Bayesian priors over probabilities and modeling proportions. |
||
| dist_beta_cdf() | Object type: Scalar function | Computes the cumulative distribution function (CDF) of the beta distribution, P(X <= x). |
| dist_beta_cdf_complement() | Object type: Scalar function | Computes the complementary cumulative distribution function (survival function) of the beta distribution, P(X > x). |
| dist_beta_chf() | Object type: Scalar function | Computes the cumulative hazard function of the beta distribution at x. |
| dist_beta_fit() | Object type: Aggregate function | Fits a beta distribution to x by maximum likelihood (Newton's method). |
| dist_beta_hazard() | Object type: Scalar function | Computes the hazard function of the beta distribution at x. |
| dist_beta_ks_test() | Object type: Aggregate function | One-sample Kolmogorov-Smirnov test of whether x follows the beta distribution with the given parameters. |
| dist_beta_kurtosis() | Object type: Scalar function | Returns the kurtosis of the beta distribution. |
| dist_beta_kurtosis_excess() | Object type: Scalar function | Returns the excess kurtosis of the beta distribution. |
| dist_beta_log_cdf() | Object type: Scalar function | Computes the natural logarithm of the cumulative distribution function (CDF) of the beta distribution. |
| dist_beta_log_cdf_complement() | Object type: Scalar function | Computes the natural logarithm of the survival function of the beta distribution, log P(X > x). |
| dist_beta_log_pdf() | Object type: Scalar function | Computes the natural logarithm of the probability density function (PDF) of the beta distribution at x. |
| dist_beta_mean() | Object type: Scalar function | Returns the mean of the beta distribution. |
| dist_beta_median() | Object type: Scalar function | Returns the median of the beta distribution. |
| dist_beta_mode() | Object type: Scalar function | Returns the mode (most likely value) of the beta distribution. |
| dist_beta_pdf() | Object type: Scalar function | Computes the probability density function (PDF) of the beta distribution at x. |
| dist_beta_quantile() | Object type: Scalar function | Computes the quantile function (inverse CDF) of the beta distribution. |
| dist_beta_quantile_complement() | Object type: Scalar function | Computes the complementary quantile function of the beta distribution. |
| dist_beta_range() | Object type: Scalar function | Returns the range of the beta distribution as [min, max]. |
| dist_beta_sample() | Object type: Scalar function | Generates a random sample from the beta distribution with the specified parameters. |
| dist_beta_samples() | Object type: Scalar function | Generates a list of n random samples from the beta distribution with the specified parameters. |
| dist_beta_skewness() | Object type: Scalar function | Returns the skewness of the beta distribution. |
| dist_beta_stddev() | Object type: Scalar function | Returns the standard deviation of the beta distribution. |
| dist_beta_support() | Object type: Scalar function | Returns the support of the beta distribution as [min, max]. |
| dist_beta_variance() | Object type: Scalar function | Returns the variance of the beta distribution. |
|
Binomial
Binomial — number of successes in n independent Bernoulli trials at success probability |
||
| dist_binomial_cdf() | Object type: Scalar function | Computes the cumulative distribution function (CDF) of the binomial distribution, P(X <= x). |
| dist_binomial_cdf_complement() | Object type: Scalar function | Computes the complementary cumulative distribution function (survival function) of the binomial distribution, P(X > x). |
| dist_binomial_chf() | Object type: Scalar function | Computes the cumulative hazard function of the binomial distribution at x. |
| dist_binomial_fit() | Object type: Aggregate function | Fits a binomial distribution to x by maximum likelihood. |
| dist_binomial_hazard() | Object type: Scalar function | Computes the hazard function of the binomial distribution at x. |
| dist_binomial_kurtosis() | Object type: Scalar function | Returns the kurtosis of the binomial distribution. |
| dist_binomial_kurtosis_excess() | Object type: Scalar function | Returns the excess kurtosis of the binomial distribution. |
| dist_binomial_log_cdf() | Object type: Scalar function | Computes the natural logarithm of the cumulative distribution function (CDF) of the binomial distribution. |
| dist_binomial_log_cdf_complement() | Object type: Scalar function | Computes the natural logarithm of the survival function of the binomial distribution, log P(X > x). |
| dist_binomial_log_pdf() | Object type: Scalar function | Computes the natural logarithm of the probability mass function (PMF) of the binomial distribution at x. |
| dist_binomial_log_pmf() | Object type: Scalar function | Computes the natural logarithm of the probability mass function (PMF) of the binomial distribution at x. |
| dist_binomial_mean() | Object type: Scalar function | Returns the mean of the binomial distribution. |
| dist_binomial_median() | Object type: Scalar function | Returns the median of the binomial distribution. |
| dist_binomial_mode() | Object type: Scalar function | Returns the mode (most likely value) of the binomial distribution. |
| dist_binomial_pdf() | Object type: Scalar function | Computes the probability mass function (PMF) of the binomial distribution at x. |
| dist_binomial_pmf() | Object type: Scalar function | Computes the probability mass function (PMF) of the binomial distribution at x, P(X = x). |
| dist_binomial_quantile() | Object type: Scalar function | Computes the quantile function (inverse CDF) of the binomial distribution. |
| dist_binomial_quantile_complement() | Object type: Scalar function | Computes the complementary quantile function of the binomial distribution. |
| dist_binomial_range() | Object type: Scalar function | Returns the range of the binomial distribution as [min, max]. |
| dist_binomial_sample() | Object type: Scalar function | Generates a random sample from the binomial distribution with the specified parameters. |
| dist_binomial_samples() | Object type: Scalar function | Generates a list of n random samples from the binomial distribution with the specified parameters. |
| dist_binomial_skewness() | Object type: Scalar function | Returns the skewness of the binomial distribution. |
| dist_binomial_stddev() | Object type: Scalar function | Returns the standard deviation of the binomial distribution. |
| dist_binomial_support() | Object type: Scalar function | Returns the support of the binomial distribution as [min, max]. |
| dist_binomial_variance() | Object type: Scalar function | Returns the variance of the binomial distribution. |
|
Cauchy
Cauchy distribution — heavy-tailed location/scale family with no defined mean. Used in robust statistics and physics. |
||
| dist_cauchy_cdf() | Object type: Scalar function | Computes the cumulative distribution function (CDF) of the Cauchy distribution, P(X <= x). |
| dist_cauchy_cdf_complement() | Object type: Scalar function | Computes the complementary cumulative distribution function (survival function) of the Cauchy distribution, P(X > x). |
| dist_cauchy_chf() | Object type: Scalar function | Computes the cumulative hazard function of the Cauchy distribution at x. |
| dist_cauchy_fit() | Object type: Aggregate function | Fits a Cauchy distribution to x by maximum likelihood (Newton's method). |
| dist_cauchy_hazard() | Object type: Scalar function | Computes the hazard function of the Cauchy distribution at x. |
| dist_cauchy_ks_test() | Object type: Aggregate function | One-sample Kolmogorov-Smirnov test of whether x follows the Cauchy distribution with the given parameters. |
| dist_cauchy_kurtosis() | Object type: Scalar function | Returns the kurtosis of the Cauchy distribution. |
| dist_cauchy_kurtosis_excess() | Object type: Scalar function | Returns the excess kurtosis of the Cauchy distribution. |
| dist_cauchy_log_cdf() | Object type: Scalar function | Computes the natural logarithm of the cumulative distribution function (CDF) of the Cauchy distribution. |
| dist_cauchy_log_cdf_complement() | Object type: Scalar function | Computes the natural logarithm of the survival function of the Cauchy distribution, log P(X > x). |
| dist_cauchy_log_pdf() | Object type: Scalar function | Computes the natural logarithm of the probability density function (PDF) of the Cauchy distribution at x. |
| dist_cauchy_mean() | Object type: Scalar function | Returns the mean of the Cauchy distribution. |
| dist_cauchy_median() | Object type: Scalar function | Returns the median of the Cauchy distribution. |
| dist_cauchy_mode() | Object type: Scalar function | Returns the mode (most likely value) of the Cauchy distribution. |
| dist_cauchy_pdf() | Object type: Scalar function | Computes the probability density function (PDF) of the Cauchy distribution at x. |
| dist_cauchy_quantile() | Object type: Scalar function | Computes the quantile function (inverse CDF) of the Cauchy distribution. |
| dist_cauchy_quantile_complement() | Object type: Scalar function | Computes the complementary quantile function of the Cauchy distribution. |
| dist_cauchy_range() | Object type: Scalar function | Returns the range of the Cauchy distribution as [min, max]. |
| dist_cauchy_sample() | Object type: Scalar function | Generates a random sample from the Cauchy distribution with the specified parameters. |
| dist_cauchy_samples() | Object type: Scalar function | Generates a list of n random samples from the Cauchy distribution with the specified parameters. |
| dist_cauchy_skewness() | Object type: Scalar function | Returns the skewness of the Cauchy distribution. |
| dist_cauchy_stddev() | Object type: Scalar function | Returns the standard deviation of the Cauchy distribution. |
| dist_cauchy_support() | Object type: Scalar function | Returns the support of the Cauchy distribution as [min, max]. |
| dist_cauchy_variance() | Object type: Scalar function | Returns the variance of the Cauchy distribution. |
|
Chi-squared
Chi-squared distribution — sum of k squared standard normals. Used in goodness-of-fit and variance tests. |
||
| dist_chi_squared_cdf() | Object type: Scalar function | Computes the cumulative distribution function (CDF) of the chi-squared distribution, P(X <= x). |
| dist_chi_squared_cdf_complement() | Object type: Scalar function | Computes the complementary cumulative distribution function (survival function) of the chi-squared distribution, P(X > x). |
| dist_chi_squared_chf() | Object type: Scalar function | Computes the cumulative hazard function of the chi-squared distribution at x. |
| dist_chi_squared_fit() | Object type: Aggregate function | Fits a chi-squared distribution to x by maximum likelihood (Newton's method). |
| dist_chi_squared_hazard() | Object type: Scalar function | Computes the hazard function of the chi-squared distribution at x. |
| dist_chi_squared_ks_test() | Object type: Aggregate function | One-sample Kolmogorov-Smirnov test of whether x follows the chi-squared distribution with the given parameters. |
| dist_chi_squared_kurtosis() | Object type: Scalar function | Returns the kurtosis of the chi-squared distribution. |
| dist_chi_squared_kurtosis_excess() | Object type: Scalar function | Returns the excess kurtosis of the chi-squared distribution. |
| dist_chi_squared_log_cdf() | Object type: Scalar function | Computes the natural logarithm of the cumulative distribution function (CDF) of the chi-squared distribution. |
| dist_chi_squared_log_cdf_complement() | Object type: Scalar function | Computes the natural logarithm of the survival function of the chi-squared distribution, log P(X > x). |
| dist_chi_squared_log_pdf() | Object type: Scalar function | Computes the natural logarithm of the probability density function (PDF) of the chi-squared distribution at x. |
| dist_chi_squared_mean() | Object type: Scalar function | Returns the mean of the chi-squared distribution. |
| dist_chi_squared_median() | Object type: Scalar function | Returns the median of the chi-squared distribution. |
| dist_chi_squared_mode() | Object type: Scalar function | Returns the mode (most likely value) of the chi-squared distribution. |
| dist_chi_squared_pdf() | Object type: Scalar function | Computes the probability density function (PDF) of the chi-squared distribution at x. |
| dist_chi_squared_quantile() | Object type: Scalar function | Computes the quantile function (inverse CDF) of the chi-squared distribution. |
| dist_chi_squared_quantile_complement() | Object type: Scalar function | Computes the complementary quantile function of the chi-squared distribution. |
| dist_chi_squared_range() | Object type: Scalar function | Returns the range of the chi-squared distribution as [min, max]. |
| dist_chi_squared_sample() | Object type: Scalar function | Generates a random sample from the chi-squared distribution with the specified parameters. |
| dist_chi_squared_samples() | Object type: Scalar function | Generates a list of n random samples from the chi-squared distribution with the specified parameters. |
| dist_chi_squared_skewness() | Object type: Scalar function | Returns the skewness of the chi-squared distribution. |
| dist_chi_squared_stddev() | Object type: Scalar function | Returns the standard deviation of the chi-squared distribution. |
| dist_chi_squared_support() | Object type: Scalar function | Returns the support of the chi-squared distribution as [min, max]. |
| dist_chi_squared_variance() | Object type: Scalar function | Returns the variance of the chi-squared distribution. |
|
Dirichlet
Dirichlet — multivariate distribution over probability vectors that sum to 1. Priors for categorical and multinomial proportions. |
||
| dist_dirichlet_log_pdf() | Object type: Scalar function | Computes the natural logarithm of the probability density function (PDF) of the Dirichlet distribution at x. |
| dist_dirichlet_mean() | Object type: Scalar function | Returns the mean of each component of the Dirichlet distribution, alpha_i / sum(alpha). |
| dist_dirichlet_pdf() | Object type: Scalar function | Computes the probability density function (PDF) of the Dirichlet distribution at x, a list of values in [0, 1] that sums to 1. |
| dist_dirichlet_sample() | Object type: Scalar function | Generates a random sample from the Dirichlet distribution with concentration parameters alpha. |
| dist_dirichlet_variance() | Object type: Scalar function | Returns the variance of each component of the Dirichlet distribution. |
|
Exponential
Exponential distribution — memoryless waiting time between events at rate λ. Survival analysis and reliability. |
||
| dist_exponential_cdf() | Object type: Scalar function | Computes the cumulative distribution function (CDF) of the exponential distribution, P(X <= x). |
| dist_exponential_cdf_complement() | Object type: Scalar function | Computes the complementary cumulative distribution function (survival function) of the exponential distribution, P(X > x). |
| dist_exponential_chf() | Object type: Scalar function | Computes the cumulative hazard function of the exponential distribution at x. |
| dist_exponential_fit() | Object type: Aggregate function | Fits a exponential distribution to x by maximum likelihood. |
| dist_exponential_hazard() | Object type: Scalar function | Computes the hazard function of the exponential distribution at x. |
| dist_exponential_ks_test() | Object type: Aggregate function | One-sample Kolmogorov-Smirnov test of whether x follows the exponential distribution with the given parameters. |
| dist_exponential_kurtosis() | Object type: Scalar function | Returns the kurtosis of the exponential distribution. |
| dist_exponential_kurtosis_excess() | Object type: Scalar function | Returns the excess kurtosis of the exponential distribution. |
| dist_exponential_log_cdf() | Object type: Scalar function | Computes the natural logarithm of the cumulative distribution function (CDF) of the exponential distribution. |
| dist_exponential_log_cdf_complement() | Object type: Scalar function | Computes the natural logarithm of the survival function of the exponential distribution, log P(X > x). |
| dist_exponential_log_pdf() | Object type: Scalar function | Computes the natural logarithm of the probability density function (PDF) of the exponential distribution at x. |
| dist_exponential_mean() | Object type: Scalar function | Returns the mean of the exponential distribution. |
| dist_exponential_median() | Object type: Scalar function | Returns the median of the exponential distribution. |
| dist_exponential_mode() | Object type: Scalar function | Returns the mode (most likely value) of the exponential distribution. |
| dist_exponential_pdf() | Object type: Scalar function | Computes the probability density function (PDF) of the exponential distribution at x. |
| dist_exponential_quantile() | Object type: Scalar function | Computes the quantile function (inverse CDF) of the exponential distribution. |
| dist_exponential_quantile_complement() | Object type: Scalar function | Computes the complementary quantile function of the exponential distribution. |
| dist_exponential_range() | Object type: Scalar function | Returns the range of the exponential distribution as [min, max]. |
| dist_exponential_sample() | Object type: Scalar function | Generates a random sample from the exponential distribution with the specified parameters. |
| dist_exponential_samples() | Object type: Scalar function | Generates a list of n random samples from the exponential distribution with the specified parameters. |
| dist_exponential_skewness() | Object type: Scalar function | Returns the skewness of the exponential distribution. |
| dist_exponential_stddev() | Object type: Scalar function | Returns the standard deviation of the exponential distribution. |
| dist_exponential_support() | Object type: Scalar function | Returns the support of the exponential distribution as [min, max]. |
| dist_exponential_variance() | Object type: Scalar function | Returns the variance of the exponential distribution. |
|
Extreme Value
Generalized extreme-value (Gumbel) — block-maxima of i.i.d. samples. Used in hydrology, insurance, climate. |
||
| dist_extreme_value_cdf() | Object type: Scalar function | Computes the cumulative distribution function (CDF) of the extreme value (Gumbel) distribution, P(X <= x). |
| dist_extreme_value_cdf_complement() | Object type: Scalar function | Computes the complementary cumulative distribution function (survival function) of the extreme value (Gumbel) distribution, P(X > x). |
| dist_extreme_value_chf() | Object type: Scalar function | Computes the cumulative hazard function of the extreme value (Gumbel) distribution at x. |
| dist_extreme_value_fit() | Object type: Aggregate function | Fits a extreme value (Gumbel) distribution to x by maximum likelihood (Newton's method). |
| dist_extreme_value_hazard() | Object type: Scalar function | Computes the hazard function of the extreme value (Gumbel) distribution at x. |
| dist_extreme_value_ks_test() | Object type: Aggregate function | One-sample Kolmogorov-Smirnov test of whether x follows the extreme value (Gumbel) distribution with the given parameters. |
| dist_extreme_value_kurtosis() | Object type: Scalar function | Returns the kurtosis of the extreme value (Gumbel) distribution. |
| dist_extreme_value_kurtosis_excess() | Object type: Scalar function | Returns the excess kurtosis of the extreme value (Gumbel) distribution. |
| dist_extreme_value_log_cdf() | Object type: Scalar function | Computes the natural logarithm of the cumulative distribution function (CDF) of the extreme value (Gumbel) distribution. |
| dist_extreme_value_log_cdf_complement() | Object type: Scalar function | Computes the natural logarithm of the survival function of the extreme value (Gumbel) distribution, log P(X > x). |
| dist_extreme_value_log_pdf() | Object type: Scalar function | Computes the natural logarithm of the probability density function (PDF) of the extreme value (Gumbel) distribution at x. |
| dist_extreme_value_mean() | Object type: Scalar function | Returns the mean of the extreme value (Gumbel) distribution. |
| dist_extreme_value_median() | Object type: Scalar function | Returns the median of the extreme value (Gumbel) distribution. |
| dist_extreme_value_mode() | Object type: Scalar function | Returns the mode (most likely value) of the extreme value (Gumbel) distribution. |
| dist_extreme_value_pdf() | Object type: Scalar function | Computes the probability density function (PDF) of the extreme value (Gumbel) distribution at x. |
| dist_extreme_value_quantile() | Object type: Scalar function | Computes the quantile function (inverse CDF) of the extreme value (Gumbel) distribution. |
| dist_extreme_value_quantile_complement() | Object type: Scalar function | Computes the complementary quantile function of the extreme value (Gumbel) distribution. |
| dist_extreme_value_range() | Object type: Scalar function | Returns the range of the extreme value (Gumbel) distribution as [min, max]. |
| dist_extreme_value_sample() | Object type: Scalar function | Generates a random sample from the extreme value (Gumbel) distribution with the specified parameters. |
| dist_extreme_value_samples() | Object type: Scalar function | Generates a list of n random samples from the extreme value (Gumbel) distribution with the specified parameters. |
| dist_extreme_value_skewness() | Object type: Scalar function | Returns the skewness of the extreme value (Gumbel) distribution. |
| dist_extreme_value_stddev() | Object type: Scalar function | Returns the standard deviation of the extreme value (Gumbel) distribution. |
| dist_extreme_value_support() | Object type: Scalar function | Returns the support of the extreme value (Gumbel) distribution as [min, max]. |
| dist_extreme_value_variance() | Object type: Scalar function | Returns the variance of the extreme value (Gumbel) distribution. |
|
Fisher F
F distribution — ratio of two scaled chi-squared variates. Backbone of ANOVA and regression hypothesis tests. |
||
| dist_fisher_f_cdf() | Object type: Scalar function | Computes the cumulative distribution function (CDF) of the Fisher's F distribution, P(X <= x). |
| dist_fisher_f_cdf_complement() | Object type: Scalar function | Computes the complementary cumulative distribution function (survival function) of the Fisher's F distribution, P(X > x). |
| dist_fisher_f_chf() | Object type: Scalar function | Computes the cumulative hazard function of the Fisher's F distribution at x. |
| dist_fisher_f_hazard() | Object type: Scalar function | Computes the hazard function of the Fisher's F distribution at x. |
| dist_fisher_f_ks_test() | Object type: Aggregate function | One-sample Kolmogorov-Smirnov test of whether x follows the Fisher's F distribution with the given parameters. |
| dist_fisher_f_kurtosis() | Object type: Scalar function | Returns the kurtosis of the Fisher's F distribution. |
| dist_fisher_f_kurtosis_excess() | Object type: Scalar function | Returns the excess kurtosis of the Fisher's F distribution. |
| dist_fisher_f_log_cdf() | Object type: Scalar function | Computes the natural logarithm of the cumulative distribution function (CDF) of the Fisher's F distribution. |
| dist_fisher_f_log_cdf_complement() | Object type: Scalar function | Computes the natural logarithm of the survival function of the Fisher's F distribution, log P(X > x). |
| dist_fisher_f_log_pdf() | Object type: Scalar function | Computes the natural logarithm of the probability density function (PDF) of the Fisher's F distribution at x. |
| dist_fisher_f_mean() | Object type: Scalar function | Returns the mean of the Fisher's F distribution. |
| dist_fisher_f_median() | Object type: Scalar function | Returns the median of the Fisher's F distribution. |
| dist_fisher_f_mode() | Object type: Scalar function | Returns the mode (most likely value) of the Fisher's F distribution. |
| dist_fisher_f_pdf() | Object type: Scalar function | Computes the probability density function (PDF) of the Fisher's F distribution at x. |
| dist_fisher_f_quantile() | Object type: Scalar function | Computes the quantile function (inverse CDF) of the Fisher's F distribution. |
| dist_fisher_f_quantile_complement() | Object type: Scalar function | Computes the complementary quantile function of the Fisher's F distribution. |
| dist_fisher_f_range() | Object type: Scalar function | Returns the range of the Fisher's F distribution as [min, max]. |
| dist_fisher_f_sample() | Object type: Scalar function | Generates a random sample from the Fisher's F distribution with the specified parameters. |
| dist_fisher_f_samples() | Object type: Scalar function | Generates a list of n random samples from the Fisher's F distribution with the specified parameters. |
| dist_fisher_f_skewness() | Object type: Scalar function | Returns the skewness of the Fisher's F distribution. |
| dist_fisher_f_stddev() | Object type: Scalar function | Returns the standard deviation of the Fisher's F distribution. |
| dist_fisher_f_support() | Object type: Scalar function | Returns the support of the Fisher's F distribution as [min, max]. |
| dist_fisher_f_variance() | Object type: Scalar function | Returns the variance of the Fisher's F distribution. |
|
Fitting
Aggregates that fit a distribution to a column by maximum likelihood and return its parameters as a STRUCT. |
||
| dist_bernoulli_fit() | Object type: Aggregate function | Fits a Bernoulli distribution to x by maximum likelihood. |
| dist_beta_fit() | Object type: Aggregate function | Fits a beta distribution to x by maximum likelihood (Newton's method). |
| dist_binomial_fit() | Object type: Aggregate function | Fits a binomial distribution to x by maximum likelihood. |
| dist_cauchy_fit() | Object type: Aggregate function | Fits a Cauchy distribution to x by maximum likelihood (Newton's method). |
| dist_chi_squared_fit() | Object type: Aggregate function | Fits a chi-squared distribution to x by maximum likelihood (Newton's method). |
| dist_exponential_fit() | Object type: Aggregate function | Fits a exponential distribution to x by maximum likelihood. |
| dist_extreme_value_fit() | Object type: Aggregate function | Fits a extreme value (Gumbel) distribution to x by maximum likelihood (Newton's method). |
| dist_fits() | Object type: Aggregate function | Fits several distributions to x by maximum likelihood and ranks them by AICc, the AIC corrected for small samples. |
| dist_gamma_fit() | Object type: Aggregate function | Fits a gamma distribution to x by maximum likelihood (Newton's method). |
| dist_geometric_fit() | Object type: Aggregate function | Fits a geometric (failures before the first success) distribution to x by maximum likelihood. |
| dist_inverse_gamma_fit() | Object type: Aggregate function | Fits a inverse gamma distribution to x by maximum likelihood (Newton's method). |
| dist_inverse_gaussian_fit() | Object type: Aggregate function | Fits a inverse Gaussian distribution to x by maximum likelihood. |
| dist_laplace_fit() | Object type: Aggregate function | Fits a Laplace distribution to x by maximum likelihood (the median and the mean absolute deviation from it). |
| dist_logistic_fit() | Object type: Aggregate function | Fits a logistic distribution to x by maximum likelihood (Newton's method). |
| dist_lognormal_fit() | Object type: Aggregate function | Fits a log-normal distribution to x by maximum likelihood. |
| dist_negative_binomial_fit() | Object type: Aggregate function | Fits a negative binomial distribution to x by maximum likelihood. |
| dist_normal_fit() | Object type: Aggregate function | Fits a normal distribution to x by maximum likelihood. |
| dist_pareto_fit() | Object type: Aggregate function | Fits a Pareto distribution to x by maximum likelihood. |
| dist_poisson_fit() | Object type: Aggregate function | Fits a Poisson distribution to x by maximum likelihood. |
| dist_rayleigh_fit() | Object type: Aggregate function | Fits a Rayleigh distribution to x by maximum likelihood. |
| dist_students_t_fit() | Object type: Aggregate function | Fits a standard Student's t distribution to x by maximum likelihood (golden section search). |
| dist_uniform_real_fit() | Object type: Aggregate function | Fits a continuous uniform distribution to x by maximum likelihood (the sample minimum and maximum). |
| dist_weibull_fit() | Object type: Aggregate function | Fits a Weibull distribution to x by maximum likelihood (Newton's method). |
|
Gamma
Gamma distribution — shape/scale family. Waiting times for k events at constant rate; flexible right-skewed prior. |
||
| dist_gamma_cdf() | Object type: Scalar function | Computes the cumulative distribution function (CDF) of the gamma distribution, P(X <= x). |
| dist_gamma_cdf_complement() | Object type: Scalar function | Computes the complementary cumulative distribution function (survival function) of the gamma distribution, P(X > x). |
| dist_gamma_chf() | Object type: Scalar function | Computes the cumulative hazard function of the gamma distribution at x. |
| dist_gamma_fit() | Object type: Aggregate function | Fits a gamma distribution to x by maximum likelihood (Newton's method). |
| dist_gamma_hazard() | Object type: Scalar function | Computes the hazard function of the gamma distribution at x. |
| dist_gamma_ks_test() | Object type: Aggregate function | One-sample Kolmogorov-Smirnov test of whether x follows the gamma distribution with the given parameters. |
| dist_gamma_kurtosis() | Object type: Scalar function | Returns the kurtosis of the gamma distribution. |
| dist_gamma_kurtosis_excess() | Object type: Scalar function | Returns the excess kurtosis of the gamma distribution. |
| dist_gamma_log_cdf() | Object type: Scalar function | Computes the natural logarithm of the cumulative distribution function (CDF) of the gamma distribution. |
| dist_gamma_log_cdf_complement() | Object type: Scalar function | Computes the natural logarithm of the survival function of the gamma distribution, log P(X > x). |
| dist_gamma_log_pdf() | Object type: Scalar function | Computes the natural logarithm of the probability density function (PDF) of the gamma distribution at x. |
| dist_gamma_mean() | Object type: Scalar function | Returns the mean of the gamma distribution. |
| dist_gamma_median() | Object type: Scalar function | Returns the median of the gamma distribution. |
| dist_gamma_mode() | Object type: Scalar function | Returns the mode (most likely value) of the gamma distribution. |
| dist_gamma_pdf() | Object type: Scalar function | Computes the probability density function (PDF) of the gamma distribution at x. |
| dist_gamma_quantile() | Object type: Scalar function | Computes the quantile function (inverse CDF) of the gamma distribution. |
| dist_gamma_quantile_complement() | Object type: Scalar function | Computes the complementary quantile function of the gamma distribution. |
| dist_gamma_range() | Object type: Scalar function | Returns the range of the gamma distribution as [min, max]. |
| dist_gamma_sample() | Object type: Scalar function | Generates a random sample from the gamma distribution with the specified parameters. |
| dist_gamma_samples() | Object type: Scalar function | Generates a list of n random samples from the gamma distribution with the specified parameters. |
| dist_gamma_skewness() | Object type: Scalar function | Returns the skewness of the gamma distribution. |
| dist_gamma_stddev() | Object type: Scalar function | Returns the standard deviation of the gamma distribution. |
| dist_gamma_support() | Object type: Scalar function | Returns the support of the gamma distribution as [min, max]. |
| dist_gamma_variance() | Object type: Scalar function | Returns the variance of the gamma distribution. |
|
Geometric
Geometric — number of failures before the first success in a Bernoulli trial sequence. |
||
| dist_geometric_cdf() | Object type: Scalar function | Computes the cumulative distribution function (CDF) of the geometric distribution, P(X <= x). |
| dist_geometric_cdf_complement() | Object type: Scalar function | Computes the complementary cumulative distribution function (survival function) of the geometric distribution, P(X > x). |
| dist_geometric_chf() | Object type: Scalar function | Computes the cumulative hazard function of the geometric distribution at x. |
| dist_geometric_fit() | Object type: Aggregate function | Fits a geometric (failures before the first success) distribution to x by maximum likelihood. |
| dist_geometric_hazard() | Object type: Scalar function | Computes the hazard function of the geometric distribution at x. |
| dist_geometric_kurtosis() | Object type: Scalar function | Returns the kurtosis of the geometric distribution. |
| dist_geometric_kurtosis_excess() | Object type: Scalar function | Returns the excess kurtosis of the geometric distribution. |
| dist_geometric_log_cdf() | Object type: Scalar function | Computes the natural logarithm of the cumulative distribution function (CDF) of the geometric distribution. |
| dist_geometric_log_cdf_complement() | Object type: Scalar function | Computes the natural logarithm of the survival function of the geometric distribution, log P(X > x). |
| dist_geometric_log_pdf() | Object type: Scalar function | Computes the natural logarithm of the probability mass function (PMF) of the geometric distribution at x. |
| dist_geometric_log_pmf() | Object type: Scalar function | Computes the natural logarithm of the probability mass function (PMF) of the geometric distribution at x. |
| dist_geometric_mean() | Object type: Scalar function | Returns the mean of the geometric distribution. |
| dist_geometric_median() | Object type: Scalar function | Returns the median of the geometric distribution. |
| dist_geometric_mode() | Object type: Scalar function | Returns the mode (most likely value) of the geometric distribution. |
| dist_geometric_pdf() | Object type: Scalar function | Computes the probability mass function (PMF) of the geometric distribution at x. |
| dist_geometric_pmf() | Object type: Scalar function | Computes the probability mass function (PMF) of the geometric distribution at x, P(X = x). |
| dist_geometric_quantile() | Object type: Scalar function | Computes the quantile function (inverse CDF) of the geometric distribution. |
| dist_geometric_quantile_complement() | Object type: Scalar function | Computes the complementary quantile function of the geometric distribution. |
| dist_geometric_range() | Object type: Scalar function | Returns the range of the geometric distribution as [min, max]. |
| dist_geometric_sample() | Object type: Scalar function | Generates a random sample from the geometric distribution with the specified parameters. |
| dist_geometric_samples() | Object type: Scalar function | Generates a list of n random samples from the geometric distribution with the specified parameters. |
| dist_geometric_skewness() | Object type: Scalar function | Returns the skewness of the geometric distribution. |
| dist_geometric_stddev() | Object type: Scalar function | Returns the standard deviation of the geometric distribution. |
| dist_geometric_support() | Object type: Scalar function | Returns the support of the geometric distribution as [min, max]. |
| dist_geometric_variance() | Object type: Scalar function | Returns the variance of the geometric distribution. |
|
Hypergeometric
Hypergeometric — successes in draws without replacement from a finite population. Quality sampling, card games, Fisher's exact test. |
||
| dist_hypergeometric_cdf() | Object type: Scalar function | Computes the cumulative distribution function (CDF) of the hypergeometric distribution, P(X <= x). |
| dist_hypergeometric_cdf_complement() | Object type: Scalar function | Computes the complementary cumulative distribution function (survival function) of the hypergeometric distribution, P(X > x). |
| dist_hypergeometric_chf() | Object type: Scalar function | Computes the cumulative hazard function of the hypergeometric distribution at x. |
| dist_hypergeometric_hazard() | Object type: Scalar function | Computes the hazard function of the hypergeometric distribution at x. |
| dist_hypergeometric_kurtosis() | Object type: Scalar function | Returns the kurtosis of the hypergeometric distribution. |
| dist_hypergeometric_kurtosis_excess() | Object type: Scalar function | Returns the excess kurtosis of the hypergeometric distribution. |
| dist_hypergeometric_log_cdf() | Object type: Scalar function | Computes the natural logarithm of the cumulative distribution function (CDF) of the hypergeometric distribution. |
| dist_hypergeometric_log_cdf_complement() | Object type: Scalar function | Computes the natural logarithm of the survival function of the hypergeometric distribution, log P(X > x). |
| dist_hypergeometric_log_pdf() | Object type: Scalar function | Computes the natural logarithm of the probability mass function (PMF) of the hypergeometric distribution at x. |
| dist_hypergeometric_log_pmf() | Object type: Scalar function | Computes the natural logarithm of the probability mass function (PMF) of the hypergeometric distribution at x. |
| dist_hypergeometric_mean() | Object type: Scalar function | Returns the mean of the hypergeometric distribution. |
| dist_hypergeometric_median() | Object type: Scalar function | Returns the median of the hypergeometric distribution. |
| dist_hypergeometric_mode() | Object type: Scalar function | Returns the mode (most likely value) of the hypergeometric distribution. |
| dist_hypergeometric_pdf() | Object type: Scalar function | Computes the probability mass function (PMF) of the hypergeometric distribution at x. |
| dist_hypergeometric_pmf() | Object type: Scalar function | Computes the probability mass function (PMF) of the hypergeometric distribution at x, P(X = x). |
| dist_hypergeometric_quantile() | Object type: Scalar function | Computes the quantile function (inverse CDF) of the hypergeometric distribution. |
| dist_hypergeometric_quantile_complement() | Object type: Scalar function | Computes the complementary quantile function of the hypergeometric distribution. |
| dist_hypergeometric_range() | Object type: Scalar function | Returns the range of the hypergeometric distribution as [min, max]. |
| dist_hypergeometric_sample() | Object type: Scalar function | Generates a random sample from the hypergeometric distribution with the specified parameters. |
| dist_hypergeometric_samples() | Object type: Scalar function | Generates a list of n random samples from the hypergeometric distribution with the specified parameters. |
| dist_hypergeometric_skewness() | Object type: Scalar function | Returns the skewness of the hypergeometric distribution. |
| dist_hypergeometric_stddev() | Object type: Scalar function | Returns the standard deviation of the hypergeometric distribution. |
| dist_hypergeometric_support() | Object type: Scalar function | Returns the support of the hypergeometric distribution as [min, max]. |
| dist_hypergeometric_variance() | Object type: Scalar function | Returns the variance of the hypergeometric distribution. |
|
Hypothesis Tests
Aggregates for Kolmogorov-Smirnov goodness-of-fit, t-tests and Pearson's chi-squared test, returning the statistic and p-value. |
||
| chi_squared_test() | Object type: Aggregate function | Pearson's chi-squared goodness-of-fit test with one row per category. |
| dist_arcsine_ks_test() | Object type: Aggregate function | One-sample Kolmogorov-Smirnov test of whether x follows the arcsine distribution with the given parameters. |
| dist_beta_ks_test() | Object type: Aggregate function | One-sample Kolmogorov-Smirnov test of whether x follows the beta distribution with the given parameters. |
| dist_cauchy_ks_test() | Object type: Aggregate function | One-sample Kolmogorov-Smirnov test of whether x follows the Cauchy distribution with the given parameters. |
| dist_chi_squared_ks_test() | Object type: Aggregate function | One-sample Kolmogorov-Smirnov test of whether x follows the chi-squared distribution with the given parameters. |
| dist_exponential_ks_test() | Object type: Aggregate function | One-sample Kolmogorov-Smirnov test of whether x follows the exponential distribution with the given parameters. |
| dist_extreme_value_ks_test() | Object type: Aggregate function | One-sample Kolmogorov-Smirnov test of whether x follows the extreme value (Gumbel) distribution with the given parameters. |
| dist_fisher_f_ks_test() | Object type: Aggregate function | One-sample Kolmogorov-Smirnov test of whether x follows the Fisher's F distribution with the given parameters. |
| dist_gamma_ks_test() | Object type: Aggregate function | One-sample Kolmogorov-Smirnov test of whether x follows the gamma distribution with the given parameters. |
| dist_inverse_chi_squared_ks_test() | Object type: Aggregate function | One-sample Kolmogorov-Smirnov test of whether x follows the scaled inverse chi-squared distribution with the given parameters. |
| dist_inverse_gamma_ks_test() | Object type: Aggregate function | One-sample Kolmogorov-Smirnov test of whether x follows the inverse gamma distribution with the given parameters. |
| dist_inverse_gaussian_ks_test() | Object type: Aggregate function | One-sample Kolmogorov-Smirnov test of whether x follows the inverse Gaussian (Wald) distribution with the given parameters. |
| dist_kolmogorov_smirnov_ks_test() | Object type: Aggregate function | One-sample Kolmogorov-Smirnov test of whether x follows the Kolmogorov-Smirnov distribution with the given parameters. |
| dist_laplace_ks_test() | Object type: Aggregate function | One-sample Kolmogorov-Smirnov test of whether x follows the Laplace distribution with the given parameters. |
| dist_logistic_ks_test() | Object type: Aggregate function | One-sample Kolmogorov-Smirnov test of whether x follows the logistic distribution with the given parameters. |
| dist_lognormal_ks_test() | Object type: Aggregate function | One-sample Kolmogorov-Smirnov test of whether x follows the log-normal distribution with the given parameters. |
| dist_non_central_beta_ks_test() | Object type: Aggregate function | One-sample Kolmogorov-Smirnov test of whether x follows the non-central beta distribution with the given parameters. |
| dist_non_central_chi_squared_ks_test() | Object type: Aggregate function | One-sample Kolmogorov-Smirnov test of whether x follows the non-central chi-squared distribution with the given parameters. |
| dist_non_central_f_ks_test() | Object type: Aggregate function | One-sample Kolmogorov-Smirnov test of whether x follows the non-central F distribution with the given parameters. |
| dist_non_central_t_ks_test() | Object type: Aggregate function | One-sample Kolmogorov-Smirnov test of whether x follows the non-central Student's t distribution with the given parameters. |
| dist_normal_ks_test() | Object type: Aggregate function | One-sample Kolmogorov-Smirnov test of whether x follows the normal distribution with the given parameters. |
| dist_pareto_ks_test() | Object type: Aggregate function | One-sample Kolmogorov-Smirnov test of whether x follows the Pareto distribution with the given parameters. |
| dist_rayleigh_ks_test() | Object type: Aggregate function | One-sample Kolmogorov-Smirnov test of whether x follows the Rayleigh distribution with the given parameters. |
| dist_skew_normal_ks_test() | Object type: Aggregate function | One-sample Kolmogorov-Smirnov test of whether x follows the skew normal distribution with the given parameters. |
| dist_students_t_ks_test() | Object type: Aggregate function | One-sample Kolmogorov-Smirnov test of whether x follows the Student's t distribution with the given parameters. |
| dist_triangular_ks_test() | Object type: Aggregate function | One-sample Kolmogorov-Smirnov test of whether x follows the triangular distribution with the given parameters. |
| dist_uniform_real_ks_test() | Object type: Aggregate function | One-sample Kolmogorov-Smirnov test of whether x follows the continuous uniform distribution with the given parameters. |
| dist_weibull_ks_test() | Object type: Aggregate function | One-sample Kolmogorov-Smirnov test of whether x follows the Weibull distribution with the given parameters. |
| one_sample_t_test() | Object type: Aggregate function | One-sample t-test of whether the mean of x equals mu. |
| student_t_test() | Object type: Aggregate function | Student's two-sample t-test with pooled variance of whether two independent samples have the same mean. |
| welch_t_test() | Object type: Aggregate function | Welch's unequal-variance t-test of whether two independent samples have the same mean. |
|
Inverse Chi-squared
Scaled inverse chi-squared — conjugate prior for a Normal variance in Bayesian inference. |
||
| dist_inverse_chi_squared_cdf() | Object type: Scalar function | Computes the cumulative distribution function (CDF) of the scaled inverse chi-squared distribution, P(X <= x). |
| dist_inverse_chi_squared_cdf_complement() | Object type: Scalar function | Computes the complementary cumulative distribution function (survival function) of the scaled inverse chi-squared distribution, P(X > x). |
| dist_inverse_chi_squared_chf() | Object type: Scalar function | Computes the cumulative hazard function of the scaled inverse chi-squared distribution at x. |
| dist_inverse_chi_squared_hazard() | Object type: Scalar function | Computes the hazard function of the scaled inverse chi-squared distribution at x. |
| dist_inverse_chi_squared_ks_test() | Object type: Aggregate function | One-sample Kolmogorov-Smirnov test of whether x follows the scaled inverse chi-squared distribution with the given parameters. |
| dist_inverse_chi_squared_kurtosis() | Object type: Scalar function | Returns the kurtosis of the scaled inverse chi-squared distribution. |
| dist_inverse_chi_squared_kurtosis_excess() | Object type: Scalar function | Returns the excess kurtosis of the scaled inverse chi-squared distribution. |
| dist_inverse_chi_squared_log_cdf() | Object type: Scalar function | Computes the natural logarithm of the cumulative distribution function (CDF) of the scaled inverse chi-squared distribution. |
| dist_inverse_chi_squared_log_cdf_complement() | Object type: Scalar function | Computes the natural logarithm of the survival function of the scaled inverse chi-squared distribution, log P(X > x). |
| dist_inverse_chi_squared_log_pdf() | Object type: Scalar function | Computes the natural logarithm of the probability density function (PDF) of the scaled inverse chi-squared distribution at x. |
| dist_inverse_chi_squared_mean() | Object type: Scalar function | Returns the mean of the scaled inverse chi-squared distribution. |
| dist_inverse_chi_squared_median() | Object type: Scalar function | Returns the median of the scaled inverse chi-squared distribution. |
| dist_inverse_chi_squared_mode() | Object type: Scalar function | Returns the mode (most likely value) of the scaled inverse chi-squared distribution. |
| dist_inverse_chi_squared_pdf() | Object type: Scalar function | Computes the probability density function (PDF) of the scaled inverse chi-squared distribution at x. |
| dist_inverse_chi_squared_quantile() | Object type: Scalar function | Computes the quantile function (inverse CDF) of the scaled inverse chi-squared distribution. |
| dist_inverse_chi_squared_quantile_complement() | Object type: Scalar function | Computes the complementary quantile function of the scaled inverse chi-squared distribution. |
| dist_inverse_chi_squared_range() | Object type: Scalar function | Returns the range of the scaled inverse chi-squared distribution as [min, max]. |
| dist_inverse_chi_squared_sample() | Object type: Scalar function | Generates a random sample from the scaled inverse chi-squared distribution with the specified parameters. |
| dist_inverse_chi_squared_samples() | Object type: Scalar function | Generates a list of n random samples from the scaled inverse chi-squared distribution with the specified parameters. |
| dist_inverse_chi_squared_skewness() | Object type: Scalar function | Returns the skewness of the scaled inverse chi-squared distribution. |
| dist_inverse_chi_squared_stddev() | Object type: Scalar function | Returns the standard deviation of the scaled inverse chi-squared distribution. |
| dist_inverse_chi_squared_support() | Object type: Scalar function | Returns the support of the scaled inverse chi-squared distribution as [min, max]. |
| dist_inverse_chi_squared_variance() | Object type: Scalar function | Returns the variance of the scaled inverse chi-squared distribution. |
|
Inverse Gamma
Inverse gamma — reciprocal of a Gamma variate. Conjugate prior for an unknown variance. |
||
| dist_inverse_gamma_cdf() | Object type: Scalar function | Computes the cumulative distribution function (CDF) of the inverse gamma distribution, P(X <= x). |
| dist_inverse_gamma_cdf_complement() | Object type: Scalar function | Computes the complementary cumulative distribution function (survival function) of the inverse gamma distribution, P(X > x). |
| dist_inverse_gamma_chf() | Object type: Scalar function | Computes the cumulative hazard function of the inverse gamma distribution at x. |
| dist_inverse_gamma_fit() | Object type: Aggregate function | Fits a inverse gamma distribution to x by maximum likelihood (Newton's method). |
| dist_inverse_gamma_hazard() | Object type: Scalar function | Computes the hazard function of the inverse gamma distribution at x. |
| dist_inverse_gamma_ks_test() | Object type: Aggregate function | One-sample Kolmogorov-Smirnov test of whether x follows the inverse gamma distribution with the given parameters. |
| dist_inverse_gamma_kurtosis() | Object type: Scalar function | Returns the kurtosis of the inverse gamma distribution. |
| dist_inverse_gamma_kurtosis_excess() | Object type: Scalar function | Returns the excess kurtosis of the inverse gamma distribution. |
| dist_inverse_gamma_log_cdf() | Object type: Scalar function | Computes the natural logarithm of the cumulative distribution function (CDF) of the inverse gamma distribution. |
| dist_inverse_gamma_log_cdf_complement() | Object type: Scalar function | Computes the natural logarithm of the survival function of the inverse gamma distribution, log P(X > x). |
| dist_inverse_gamma_log_pdf() | Object type: Scalar function | Computes the natural logarithm of the probability density function (PDF) of the inverse gamma distribution at x. |
| dist_inverse_gamma_mean() | Object type: Scalar function | Returns the mean of the inverse gamma distribution. |
| dist_inverse_gamma_median() | Object type: Scalar function | Returns the median of the inverse gamma distribution. |
| dist_inverse_gamma_mode() | Object type: Scalar function | Returns the mode (most likely value) of the inverse gamma distribution. |
| dist_inverse_gamma_pdf() | Object type: Scalar function | Computes the probability density function (PDF) of the inverse gamma distribution at x. |
| dist_inverse_gamma_quantile() | Object type: Scalar function | Computes the quantile function (inverse CDF) of the inverse gamma distribution. |
| dist_inverse_gamma_quantile_complement() | Object type: Scalar function | Computes the complementary quantile function of the inverse gamma distribution. |
| dist_inverse_gamma_range() | Object type: Scalar function | Returns the range of the inverse gamma distribution as [min, max]. |
| dist_inverse_gamma_sample() | Object type: Scalar function | Generates a random sample from the inverse gamma distribution with the specified parameters. |
| dist_inverse_gamma_samples() | Object type: Scalar function | Generates a list of n random samples from the inverse gamma distribution with the specified parameters. |
| dist_inverse_gamma_skewness() | Object type: Scalar function | Returns the skewness of the inverse gamma distribution. |
| dist_inverse_gamma_stddev() | Object type: Scalar function | Returns the standard deviation of the inverse gamma distribution. |
| dist_inverse_gamma_support() | Object type: Scalar function | Returns the support of the inverse gamma distribution as [min, max]. |
| dist_inverse_gamma_variance() | Object type: Scalar function | Returns the variance of the inverse gamma distribution. |
|
Inverse Gaussian
Inverse Gaussian (Wald) — first passage time of Brownian motion with drift. Right-skewed positive durations. |
||
| dist_inverse_gaussian_cdf() | Object type: Scalar function | Computes the cumulative distribution function (CDF) of the inverse Gaussian (Wald) distribution, P(X <= x). |
| dist_inverse_gaussian_cdf_complement() | Object type: Scalar function | Computes the complementary cumulative distribution function (survival function) of the inverse Gaussian (Wald) distribution, P(X > x). |
| dist_inverse_gaussian_chf() | Object type: Scalar function | Computes the cumulative hazard function of the inverse Gaussian (Wald) distribution at x. |
| dist_inverse_gaussian_fit() | Object type: Aggregate function | Fits a inverse Gaussian distribution to x by maximum likelihood. |
| dist_inverse_gaussian_hazard() | Object type: Scalar function | Computes the hazard function of the inverse Gaussian (Wald) distribution at x. |
| dist_inverse_gaussian_ks_test() | Object type: Aggregate function | One-sample Kolmogorov-Smirnov test of whether x follows the inverse Gaussian (Wald) distribution with the given parameters. |
| dist_inverse_gaussian_kurtosis() | Object type: Scalar function | Returns the kurtosis of the inverse Gaussian (Wald) distribution. |
| dist_inverse_gaussian_kurtosis_excess() | Object type: Scalar function | Returns the excess kurtosis of the inverse Gaussian (Wald) distribution. |
| dist_inverse_gaussian_log_cdf() | Object type: Scalar function | Computes the natural logarithm of the cumulative distribution function (CDF) of the inverse Gaussian (Wald) distribution. |
| dist_inverse_gaussian_log_cdf_complement() | Object type: Scalar function | Computes the natural logarithm of the survival function of the inverse Gaussian (Wald) distribution, log P(X > x). |
| dist_inverse_gaussian_log_pdf() | Object type: Scalar function | Computes the natural logarithm of the probability density function (PDF) of the inverse Gaussian (Wald) distribution at x. |
| dist_inverse_gaussian_mean() | Object type: Scalar function | Returns the mean of the inverse Gaussian (Wald) distribution. |
| dist_inverse_gaussian_median() | Object type: Scalar function | Returns the median of the inverse Gaussian (Wald) distribution. |
| dist_inverse_gaussian_mode() | Object type: Scalar function | Returns the mode (most likely value) of the inverse Gaussian (Wald) distribution. |
| dist_inverse_gaussian_pdf() | Object type: Scalar function | Computes the probability density function (PDF) of the inverse Gaussian (Wald) distribution at x. |
| dist_inverse_gaussian_quantile() | Object type: Scalar function | Computes the quantile function (inverse CDF) of the inverse Gaussian (Wald) distribution. |
| dist_inverse_gaussian_quantile_complement() | Object type: Scalar function | Computes the complementary quantile function of the inverse Gaussian (Wald) distribution. |
| dist_inverse_gaussian_range() | Object type: Scalar function | Returns the range of the inverse Gaussian (Wald) distribution as [min, max]. |
| dist_inverse_gaussian_sample() | Object type: Scalar function | Generates a random sample from the inverse Gaussian (Wald) distribution with the specified parameters. |
| dist_inverse_gaussian_samples() | Object type: Scalar function | Generates a list of n random samples from the inverse Gaussian (Wald) distribution with the specified parameters. |
| dist_inverse_gaussian_skewness() | Object type: Scalar function | Returns the skewness of the inverse Gaussian (Wald) distribution. |
| dist_inverse_gaussian_stddev() | Object type: Scalar function | Returns the standard deviation of the inverse Gaussian (Wald) distribution. |
| dist_inverse_gaussian_support() | Object type: Scalar function | Returns the support of the inverse Gaussian (Wald) distribution as [min, max]. |
| dist_inverse_gaussian_variance() | Object type: Scalar function | Returns the variance of the inverse Gaussian (Wald) distribution. |
|
Kolmogorov-Smirnov
Kolmogorov-Smirnov — limiting distribution of the one-sample KS statistic D for n observations. Goodness-of-fit p-values. |
||
| dist_kolmogorov_smirnov_cdf() | Object type: Scalar function | Computes the cumulative distribution function (CDF) of the Kolmogorov-Smirnov distribution, P(X <= x). |
| dist_kolmogorov_smirnov_cdf_complement() | Object type: Scalar function | Computes the complementary cumulative distribution function (survival function) of the Kolmogorov-Smirnov distribution, P(X > x). |
| dist_kolmogorov_smirnov_chf() | Object type: Scalar function | Computes the cumulative hazard function of the Kolmogorov-Smirnov distribution at x. |
| dist_kolmogorov_smirnov_hazard() | Object type: Scalar function | Computes the hazard function of the Kolmogorov-Smirnov distribution at x. |
| dist_kolmogorov_smirnov_ks_test() | Object type: Aggregate function | One-sample Kolmogorov-Smirnov test of whether x follows the Kolmogorov-Smirnov distribution with the given parameters. |
| dist_kolmogorov_smirnov_kurtosis() | Object type: Scalar function | Returns the kurtosis of the Kolmogorov-Smirnov distribution. |
| dist_kolmogorov_smirnov_kurtosis_excess() | Object type: Scalar function | Returns the excess kurtosis of the Kolmogorov-Smirnov distribution. |
| dist_kolmogorov_smirnov_log_cdf() | Object type: Scalar function | Computes the natural logarithm of the cumulative distribution function (CDF) of the Kolmogorov-Smirnov distribution. |
| dist_kolmogorov_smirnov_log_cdf_complement() | Object type: Scalar function | Computes the natural logarithm of the survival function of the Kolmogorov-Smirnov distribution, log P(X > x). |
| dist_kolmogorov_smirnov_log_pdf() | Object type: Scalar function | Computes the natural logarithm of the probability density function (PDF) of the Kolmogorov-Smirnov distribution at x. |
| dist_kolmogorov_smirnov_mean() | Object type: Scalar function | Returns the mean of the Kolmogorov-Smirnov distribution. |
| dist_kolmogorov_smirnov_median() | Object type: Scalar function | Returns the median of the Kolmogorov-Smirnov distribution. |
| dist_kolmogorov_smirnov_mode() | Object type: Scalar function | Returns the mode (most likely value) of the Kolmogorov-Smirnov distribution. |
| dist_kolmogorov_smirnov_pdf() | Object type: Scalar function | Computes the probability density function (PDF) of the Kolmogorov-Smirnov distribution at x. |
| dist_kolmogorov_smirnov_quantile() | Object type: Scalar function | Computes the quantile function (inverse CDF) of the Kolmogorov-Smirnov distribution. |
| dist_kolmogorov_smirnov_quantile_complement() | Object type: Scalar function | Computes the complementary quantile function of the Kolmogorov-Smirnov distribution. |
| dist_kolmogorov_smirnov_range() | Object type: Scalar function | Returns the range of the Kolmogorov-Smirnov distribution as [min, max]. |
| dist_kolmogorov_smirnov_sample() | Object type: Scalar function | Generates a random sample from the Kolmogorov-Smirnov distribution with the specified parameters. |
| dist_kolmogorov_smirnov_samples() | Object type: Scalar function | Generates a list of n random samples from the Kolmogorov-Smirnov distribution with the specified parameters. |
| dist_kolmogorov_smirnov_skewness() | Object type: Scalar function | Returns the skewness of the Kolmogorov-Smirnov distribution. |
| dist_kolmogorov_smirnov_stddev() | Object type: Scalar function | Returns the standard deviation of the Kolmogorov-Smirnov distribution. |
| dist_kolmogorov_smirnov_support() | Object type: Scalar function | Returns the support of the Kolmogorov-Smirnov distribution as [min, max]. |
| dist_kolmogorov_smirnov_variance() | Object type: Scalar function | Returns the variance of the Kolmogorov-Smirnov distribution. |
|
Laplace
Laplace (double exponential) — location/scale. Heavier tails than Normal; used in regularized regression and noise modeling. |
||
| dist_laplace_cdf() | Object type: Scalar function | Computes the cumulative distribution function (CDF) of the Laplace distribution, P(X <= x). |
| dist_laplace_cdf_complement() | Object type: Scalar function | Computes the complementary cumulative distribution function (survival function) of the Laplace distribution, P(X > x). |
| dist_laplace_chf() | Object type: Scalar function | Computes the cumulative hazard function of the Laplace distribution at x. |
| dist_laplace_fit() | Object type: Aggregate function | Fits a Laplace distribution to x by maximum likelihood (the median and the mean absolute deviation from it). |
| dist_laplace_hazard() | Object type: Scalar function | Computes the hazard function of the Laplace distribution at x. |
| dist_laplace_ks_test() | Object type: Aggregate function | One-sample Kolmogorov-Smirnov test of whether x follows the Laplace distribution with the given parameters. |
| dist_laplace_kurtosis() | Object type: Scalar function | Returns the kurtosis of the Laplace distribution. |
| dist_laplace_kurtosis_excess() | Object type: Scalar function | Returns the excess kurtosis of the Laplace distribution. |
| dist_laplace_log_cdf() | Object type: Scalar function | Computes the natural logarithm of the cumulative distribution function (CDF) of the Laplace distribution. |
| dist_laplace_log_cdf_complement() | Object type: Scalar function | Computes the natural logarithm of the survival function of the Laplace distribution, log P(X > x). |
| dist_laplace_log_pdf() | Object type: Scalar function | Computes the natural logarithm of the probability density function (PDF) of the Laplace distribution at x. |
| dist_laplace_mean() | Object type: Scalar function | Returns the mean of the Laplace distribution. |
| dist_laplace_median() | Object type: Scalar function | Returns the median of the Laplace distribution. |
| dist_laplace_mode() | Object type: Scalar function | Returns the mode (most likely value) of the Laplace distribution. |
| dist_laplace_pdf() | Object type: Scalar function | Computes the probability density function (PDF) of the Laplace distribution at x. |
| dist_laplace_quantile() | Object type: Scalar function | Computes the quantile function (inverse CDF) of the Laplace distribution. |
| dist_laplace_quantile_complement() | Object type: Scalar function | Computes the complementary quantile function of the Laplace distribution. |
| dist_laplace_range() | Object type: Scalar function | Returns the range of the Laplace distribution as [min, max]. |
| dist_laplace_sample() | Object type: Scalar function | Generates a random sample from the Laplace distribution with the specified parameters. |
| dist_laplace_samples() | Object type: Scalar function | Generates a list of n random samples from the Laplace distribution with the specified parameters. |
| dist_laplace_skewness() | Object type: Scalar function | Returns the skewness of the Laplace distribution. |
| dist_laplace_stddev() | Object type: Scalar function | Returns the standard deviation of the Laplace distribution. |
| dist_laplace_support() | Object type: Scalar function | Returns the support of the Laplace distribution as [min, max]. |
| dist_laplace_variance() | Object type: Scalar function | Returns the variance of the Laplace distribution. |
|
Log-normal
Log-normal — exp of a Normal. Models multiplicative growth, income, lifetimes; right-skewed with heavy tail. |
||
| dist_lognormal_cdf() | Object type: Scalar function | Computes the cumulative distribution function (CDF) of the log-normal distribution, P(X <= x). |
| dist_lognormal_cdf_complement() | Object type: Scalar function | Computes the complementary cumulative distribution function (survival function) of the log-normal distribution, P(X > x). |
| dist_lognormal_chf() | Object type: Scalar function | Computes the cumulative hazard function of the log-normal distribution at x. |
| dist_lognormal_fit() | Object type: Aggregate function | Fits a log-normal distribution to x by maximum likelihood. |
| dist_lognormal_hazard() | Object type: Scalar function | Computes the hazard function of the log-normal distribution at x. |
| dist_lognormal_ks_test() | Object type: Aggregate function | One-sample Kolmogorov-Smirnov test of whether x follows the log-normal distribution with the given parameters. |
| dist_lognormal_kurtosis() | Object type: Scalar function | Returns the kurtosis of the log-normal distribution. |
| dist_lognormal_kurtosis_excess() | Object type: Scalar function | Returns the excess kurtosis of the log-normal distribution. |
| dist_lognormal_log_cdf() | Object type: Scalar function | Computes the natural logarithm of the cumulative distribution function (CDF) of the log-normal distribution. |
| dist_lognormal_log_cdf_complement() | Object type: Scalar function | Computes the natural logarithm of the survival function of the log-normal distribution, log P(X > x). |
| dist_lognormal_log_pdf() | Object type: Scalar function | Computes the natural logarithm of the probability density function (PDF) of the log-normal distribution at x. |
| dist_lognormal_mean() | Object type: Scalar function | Returns the mean of the log-normal distribution. |
| dist_lognormal_median() | Object type: Scalar function | Returns the median of the log-normal distribution. |
| dist_lognormal_mode() | Object type: Scalar function | Returns the mode (most likely value) of the log-normal distribution. |
| dist_lognormal_pdf() | Object type: Scalar function | Computes the probability density function (PDF) of the log-normal distribution at x. |
| dist_lognormal_quantile() | Object type: Scalar function | Computes the quantile function (inverse CDF) of the log-normal distribution. |
| dist_lognormal_quantile_complement() | Object type: Scalar function | Computes the complementary quantile function of the log-normal distribution. |
| dist_lognormal_range() | Object type: Scalar function | Returns the range of the log-normal distribution as [min, max]. |
| dist_lognormal_sample() | Object type: Scalar function | Generates a random sample from the log-normal distribution with the specified parameters. |
| dist_lognormal_samples() | Object type: Scalar function | Generates a list of n random samples from the log-normal distribution with the specified parameters. |
| dist_lognormal_skewness() | Object type: Scalar function | Returns the skewness of the log-normal distribution. |
| dist_lognormal_stddev() | Object type: Scalar function | Returns the standard deviation of the log-normal distribution. |
| dist_lognormal_support() | Object type: Scalar function | Returns the support of the log-normal distribution as [min, max]. |
| dist_lognormal_variance() | Object type: Scalar function | Returns the variance of the log-normal distribution. |
|
Logistic
Logistic distribution — symmetric S-curve via location/scale. Backbone of logistic regression and Elo-style ratings. |
||
| dist_logistic_cdf() | Object type: Scalar function | Computes the cumulative distribution function (CDF) of the logistic distribution, P(X <= x). |
| dist_logistic_cdf_complement() | Object type: Scalar function | Computes the complementary cumulative distribution function (survival function) of the logistic distribution, P(X > x). |
| dist_logistic_chf() | Object type: Scalar function | Computes the cumulative hazard function of the logistic distribution at x. |
| dist_logistic_fit() | Object type: Aggregate function | Fits a logistic distribution to x by maximum likelihood (Newton's method). |
| dist_logistic_hazard() | Object type: Scalar function | Computes the hazard function of the logistic distribution at x. |
| dist_logistic_ks_test() | Object type: Aggregate function | One-sample Kolmogorov-Smirnov test of whether x follows the logistic distribution with the given parameters. |
| dist_logistic_kurtosis() | Object type: Scalar function | Returns the kurtosis of the logistic distribution. |
| dist_logistic_kurtosis_excess() | Object type: Scalar function | Returns the excess kurtosis of the logistic distribution. |
| dist_logistic_log_cdf() | Object type: Scalar function | Computes the natural logarithm of the cumulative distribution function (CDF) of the logistic distribution. |
| dist_logistic_log_cdf_complement() | Object type: Scalar function | Computes the natural logarithm of the survival function of the logistic distribution, log P(X > x). |
| dist_logistic_log_pdf() | Object type: Scalar function | Computes the natural logarithm of the probability density function (PDF) of the logistic distribution at x. |
| dist_logistic_mean() | Object type: Scalar function | Returns the mean of the logistic distribution. |
| dist_logistic_median() | Object type: Scalar function | Returns the median of the logistic distribution. |
| dist_logistic_mode() | Object type: Scalar function | Returns the mode (most likely value) of the logistic distribution. |
| dist_logistic_pdf() | Object type: Scalar function | Computes the probability density function (PDF) of the logistic distribution at x. |
| dist_logistic_quantile() | Object type: Scalar function | Computes the quantile function (inverse CDF) of the logistic distribution. |
| dist_logistic_quantile_complement() | Object type: Scalar function | Computes the complementary quantile function of the logistic distribution. |
| dist_logistic_range() | Object type: Scalar function | Returns the range of the logistic distribution as [min, max]. |
| dist_logistic_sample() | Object type: Scalar function | Generates a random sample from the logistic distribution with the specified parameters. |
| dist_logistic_samples() | Object type: Scalar function | Generates a list of n random samples from the logistic distribution with the specified parameters. |
| dist_logistic_skewness() | Object type: Scalar function | Returns the skewness of the logistic distribution. |
| dist_logistic_stddev() | Object type: Scalar function | Returns the standard deviation of the logistic distribution. |
| dist_logistic_support() | Object type: Scalar function | Returns the support of the logistic distribution as [min, max]. |
| dist_logistic_variance() | Object type: Scalar function | Returns the variance of the logistic distribution. |
|
Multinomial
Multinomial — counts of each outcome across a fixed number of categorical trials. Generalizes the Binomial to k categories. |
||
| dist_multinomial_log_pdf() | Object type: Scalar function | Computes the natural logarithm of the probability mass function (PMF) of the multinomial distribution at the counts x. |
| dist_multinomial_log_pmf() | Object type: Scalar function | Computes the natural logarithm of the probability mass function (PMF) of the multinomial distribution at the counts x. |
| dist_multinomial_mean() | Object type: Scalar function | Returns the mean count of each outcome of the multinomial distribution, trials * probs_i. |
| dist_multinomial_pdf() | Object type: Scalar function | Computes the probability mass function (PMF) of the multinomial distribution: the probability of observing the counts x. |
| dist_multinomial_pmf() | Object type: Scalar function | Computes the probability mass function (PMF) of the multinomial distribution: the probability of observing the counts x. |
| dist_multinomial_sample() | Object type: Scalar function | Generates a random sample from the multinomial distribution: the counts of each outcome in trials draws with outcome probabilities probs. |
| dist_multinomial_variance() | Object type: Scalar function | Returns the variance of the count of each outcome of the multinomial distribution, trials * p_i * (1 - p_i). |
|
Negative Binomial
Negative Binomial — number of failures before r successes. Used for over-dispersed count data. |
||
| dist_negative_binomial_cdf() | Object type: Scalar function | Computes the cumulative distribution function (CDF) of the negative binomial distribution, P(X <= x). |
| dist_negative_binomial_cdf_complement() | Object type: Scalar function | Computes the complementary cumulative distribution function (survival function) of the negative binomial distribution, P(X > x). |
| dist_negative_binomial_chf() | Object type: Scalar function | Computes the cumulative hazard function of the negative binomial distribution at x. |
| dist_negative_binomial_fit() | Object type: Aggregate function | Fits a negative binomial distribution to x by maximum likelihood. |
| dist_negative_binomial_hazard() | Object type: Scalar function | Computes the hazard function of the negative binomial distribution at x. |
| dist_negative_binomial_kurtosis() | Object type: Scalar function | Returns the kurtosis of the negative binomial distribution. |
| dist_negative_binomial_kurtosis_excess() | Object type: Scalar function | Returns the excess kurtosis of the negative binomial distribution. |
| dist_negative_binomial_log_cdf() | Object type: Scalar function | Computes the natural logarithm of the cumulative distribution function (CDF) of the negative binomial distribution. |
| dist_negative_binomial_log_cdf_complement() | Object type: Scalar function | Computes the natural logarithm of the survival function of the negative binomial distribution, log P(X > x). |
| dist_negative_binomial_log_pdf() | Object type: Scalar function | Computes the natural logarithm of the probability mass function (PMF) of the negative binomial distribution at x. |
| dist_negative_binomial_log_pmf() | Object type: Scalar function | Computes the natural logarithm of the probability mass function (PMF) of the negative binomial distribution at x. |
| dist_negative_binomial_mean() | Object type: Scalar function | Returns the mean of the negative binomial distribution. |
| dist_negative_binomial_median() | Object type: Scalar function | Returns the median of the negative binomial distribution. |
| dist_negative_binomial_mode() | Object type: Scalar function | Returns the mode (most likely value) of the negative binomial distribution. |
| dist_negative_binomial_pdf() | Object type: Scalar function | Computes the probability mass function (PMF) of the negative binomial distribution at x. |
| dist_negative_binomial_pmf() | Object type: Scalar function | Computes the probability mass function (PMF) of the negative binomial distribution at x, P(X = x). |
| dist_negative_binomial_quantile() | Object type: Scalar function | Computes the quantile function (inverse CDF) of the negative binomial distribution. |
| dist_negative_binomial_quantile_complement() | Object type: Scalar function | Computes the complementary quantile function of the negative binomial distribution. |
| dist_negative_binomial_range() | Object type: Scalar function | Returns the range of the negative binomial distribution as [min, max]. |
| dist_negative_binomial_sample() | Object type: Scalar function | Generates a random sample from the negative binomial distribution with the specified parameters. |
| dist_negative_binomial_samples() | Object type: Scalar function | Generates a list of n random samples from the negative binomial distribution with the specified parameters. |
| dist_negative_binomial_skewness() | Object type: Scalar function | Returns the skewness of the negative binomial distribution. |
| dist_negative_binomial_stddev() | Object type: Scalar function | Returns the standard deviation of the negative binomial distribution. |
| dist_negative_binomial_support() | Object type: Scalar function | Returns the support of the negative binomial distribution as [min, max]. |
| dist_negative_binomial_variance() | Object type: Scalar function | Returns the variance of the negative binomial distribution. |
|
Non-central Beta
Non-central beta — beta with a non-centrality parameter. Power calculations for tests built on beta ratios. |
||
| dist_non_central_beta_cdf() | Object type: Scalar function | Computes the cumulative distribution function (CDF) of the non-central beta distribution, P(X <= x). |
| dist_non_central_beta_cdf_complement() | Object type: Scalar function | Computes the complementary cumulative distribution function (survival function) of the non-central beta distribution, P(X > x). |
| dist_non_central_beta_chf() | Object type: Scalar function | Computes the cumulative hazard function of the non-central beta distribution at x. |
| dist_non_central_beta_hazard() | Object type: Scalar function | Computes the hazard function of the non-central beta distribution at x. |
| dist_non_central_beta_ks_test() | Object type: Aggregate function | One-sample Kolmogorov-Smirnov test of whether x follows the non-central beta distribution with the given parameters. |
| dist_non_central_beta_kurtosis() | Object type: Scalar function | Returns the kurtosis of the non-central beta distribution. |
| dist_non_central_beta_kurtosis_excess() | Object type: Scalar function | Returns the excess kurtosis of the non-central beta distribution. |
| dist_non_central_beta_log_cdf() | Object type: Scalar function | Computes the natural logarithm of the cumulative distribution function (CDF) of the non-central beta distribution. |
| dist_non_central_beta_log_cdf_complement() | Object type: Scalar function | Computes the natural logarithm of the survival function of the non-central beta distribution, log P(X > x). |
| dist_non_central_beta_log_pdf() | Object type: Scalar function | Computes the natural logarithm of the probability density function (PDF) of the non-central beta distribution at x. |
| dist_non_central_beta_mean() | Object type: Scalar function | Returns the mean of the non-central beta distribution. |
| dist_non_central_beta_median() | Object type: Scalar function | Returns the median of the non-central beta distribution. |
| dist_non_central_beta_mode() | Object type: Scalar function | Returns the mode (most likely value) of the non-central beta distribution. |
| dist_non_central_beta_pdf() | Object type: Scalar function | Computes the probability density function (PDF) of the non-central beta distribution at x. |
| dist_non_central_beta_quantile() | Object type: Scalar function | Computes the quantile function (inverse CDF) of the non-central beta distribution. |
| dist_non_central_beta_quantile_complement() | Object type: Scalar function | Computes the complementary quantile function of the non-central beta distribution. |
| dist_non_central_beta_range() | Object type: Scalar function | Returns the range of the non-central beta distribution as [min, max]. |
| dist_non_central_beta_sample() | Object type: Scalar function | Generates a random sample from the non-central beta distribution with the specified parameters. |
| dist_non_central_beta_samples() | Object type: Scalar function | Generates a list of n random samples from the non-central beta distribution with the specified parameters. |
| dist_non_central_beta_skewness() | Object type: Scalar function | Returns the skewness of the non-central beta distribution. |
| dist_non_central_beta_stddev() | Object type: Scalar function | Returns the standard deviation of the non-central beta distribution. |
| dist_non_central_beta_support() | Object type: Scalar function | Returns the support of the non-central beta distribution as [min, max]. |
| dist_non_central_beta_variance() | Object type: Scalar function | Returns the variance of the non-central beta distribution. |
|
Non-central Chi-squared
Non-central chi-squared — sum of squared Normals with non-zero means. Power of chi-squared tests. |
||
| dist_non_central_chi_squared_cdf() | Object type: Scalar function | Computes the cumulative distribution function (CDF) of the non-central chi-squared distribution, P(X <= x). |
| dist_non_central_chi_squared_cdf_complement() | Object type: Scalar function | Computes the complementary cumulative distribution function (survival function) of the non-central chi-squared distribution, P(X > x). |
| dist_non_central_chi_squared_chf() | Object type: Scalar function | Computes the cumulative hazard function of the non-central chi-squared distribution at x. |
| dist_non_central_chi_squared_hazard() | Object type: Scalar function | Computes the hazard function of the non-central chi-squared distribution at x. |
| dist_non_central_chi_squared_ks_test() | Object type: Aggregate function | One-sample Kolmogorov-Smirnov test of whether x follows the non-central chi-squared distribution with the given parameters. |
| dist_non_central_chi_squared_kurtosis() | Object type: Scalar function | Returns the kurtosis of the non-central chi-squared distribution. |
| dist_non_central_chi_squared_kurtosis_excess() | Object type: Scalar function | Returns the excess kurtosis of the non-central chi-squared distribution. |
| dist_non_central_chi_squared_log_cdf() | Object type: Scalar function | Computes the natural logarithm of the cumulative distribution function (CDF) of the non-central chi-squared distribution. |
| dist_non_central_chi_squared_log_cdf_complement() | Object type: Scalar function | Computes the natural logarithm of the survival function of the non-central chi-squared distribution, log P(X > x). |
| dist_non_central_chi_squared_log_pdf() | Object type: Scalar function | Computes the natural logarithm of the probability density function (PDF) of the non-central chi-squared distribution at x. |
| dist_non_central_chi_squared_mean() | Object type: Scalar function | Returns the mean of the non-central chi-squared distribution. |
| dist_non_central_chi_squared_median() | Object type: Scalar function | Returns the median of the non-central chi-squared distribution. |
| dist_non_central_chi_squared_mode() | Object type: Scalar function | Returns the mode (most likely value) of the non-central chi-squared distribution. |
| dist_non_central_chi_squared_pdf() | Object type: Scalar function | Computes the probability density function (PDF) of the non-central chi-squared distribution at x. |
| dist_non_central_chi_squared_quantile() | Object type: Scalar function | Computes the quantile function (inverse CDF) of the non-central chi-squared distribution. |
| dist_non_central_chi_squared_quantile_complement() | Object type: Scalar function | Computes the complementary quantile function of the non-central chi-squared distribution. |
| dist_non_central_chi_squared_range() | Object type: Scalar function | Returns the range of the non-central chi-squared distribution as [min, max]. |
| dist_non_central_chi_squared_sample() | Object type: Scalar function | Generates a random sample from the non-central chi-squared distribution with the specified parameters. |
| dist_non_central_chi_squared_samples() | Object type: Scalar function | Generates a list of n random samples from the non-central chi-squared distribution with the specified parameters. |
| dist_non_central_chi_squared_skewness() | Object type: Scalar function | Returns the skewness of the non-central chi-squared distribution. |
| dist_non_central_chi_squared_stddev() | Object type: Scalar function | Returns the standard deviation of the non-central chi-squared distribution. |
| dist_non_central_chi_squared_support() | Object type: Scalar function | Returns the support of the non-central chi-squared distribution as [min, max]. |
| dist_non_central_chi_squared_variance() | Object type: Scalar function | Returns the variance of the non-central chi-squared distribution. |
|
Non-central F
Non-central F — F ratio under the alternative hypothesis. Power analysis for ANOVA and regression F-tests. |
||
| dist_non_central_f_cdf() | Object type: Scalar function | Computes the cumulative distribution function (CDF) of the non-central F distribution, P(X <= x). |
| dist_non_central_f_cdf_complement() | Object type: Scalar function | Computes the complementary cumulative distribution function (survival function) of the non-central F distribution, P(X > x). |
| dist_non_central_f_chf() | Object type: Scalar function | Computes the cumulative hazard function of the non-central F distribution at x. |
| dist_non_central_f_hazard() | Object type: Scalar function | Computes the hazard function of the non-central F distribution at x. |
| dist_non_central_f_ks_test() | Object type: Aggregate function | One-sample Kolmogorov-Smirnov test of whether x follows the non-central F distribution with the given parameters. |
| dist_non_central_f_kurtosis() | Object type: Scalar function | Returns the kurtosis of the non-central F distribution. |
| dist_non_central_f_kurtosis_excess() | Object type: Scalar function | Returns the excess kurtosis of the non-central F distribution. |
| dist_non_central_f_log_cdf() | Object type: Scalar function | Computes the natural logarithm of the cumulative distribution function (CDF) of the non-central F distribution. |
| dist_non_central_f_log_cdf_complement() | Object type: Scalar function | Computes the natural logarithm of the survival function of the non-central F distribution, log P(X > x). |
| dist_non_central_f_log_pdf() | Object type: Scalar function | Computes the natural logarithm of the probability density function (PDF) of the non-central F distribution at x. |
| dist_non_central_f_mean() | Object type: Scalar function | Returns the mean of the non-central F distribution. |
| dist_non_central_f_median() | Object type: Scalar function | Returns the median of the non-central F distribution. |
| dist_non_central_f_mode() | Object type: Scalar function | Returns the mode (most likely value) of the non-central F distribution. |
| dist_non_central_f_pdf() | Object type: Scalar function | Computes the probability density function (PDF) of the non-central F distribution at x. |
| dist_non_central_f_quantile() | Object type: Scalar function | Computes the quantile function (inverse CDF) of the non-central F distribution. |
| dist_non_central_f_quantile_complement() | Object type: Scalar function | Computes the complementary quantile function of the non-central F distribution. |
| dist_non_central_f_range() | Object type: Scalar function | Returns the range of the non-central F distribution as [min, max]. |
| dist_non_central_f_sample() | Object type: Scalar function | Generates a random sample from the non-central F distribution with the specified parameters. |
| dist_non_central_f_samples() | Object type: Scalar function | Generates a list of n random samples from the non-central F distribution with the specified parameters. |
| dist_non_central_f_skewness() | Object type: Scalar function | Returns the skewness of the non-central F distribution. |
| dist_non_central_f_stddev() | Object type: Scalar function | Returns the standard deviation of the non-central F distribution. |
| dist_non_central_f_support() | Object type: Scalar function | Returns the support of the non-central F distribution as [min, max]. |
| dist_non_central_f_variance() | Object type: Scalar function | Returns the variance of the non-central F distribution. |
|
Non-central t
Non-central Student's t — t statistic under a shifted mean. Power and sample-size calculations for t-tests. |
||
| dist_non_central_t_cdf() | Object type: Scalar function | Computes the cumulative distribution function (CDF) of the non-central Student's t distribution, P(X <= x). |
| dist_non_central_t_cdf_complement() | Object type: Scalar function | Computes the complementary cumulative distribution function (survival function) of the non-central Student's t distribution, P(X > x). |
| dist_non_central_t_chf() | Object type: Scalar function | Computes the cumulative hazard function of the non-central Student's t distribution at x. |
| dist_non_central_t_hazard() | Object type: Scalar function | Computes the hazard function of the non-central Student's t distribution at x. |
| dist_non_central_t_ks_test() | Object type: Aggregate function | One-sample Kolmogorov-Smirnov test of whether x follows the non-central Student's t distribution with the given parameters. |
| dist_non_central_t_kurtosis() | Object type: Scalar function | Returns the kurtosis of the non-central Student's t distribution. |
| dist_non_central_t_kurtosis_excess() | Object type: Scalar function | Returns the excess kurtosis of the non-central Student's t distribution. |
| dist_non_central_t_log_cdf() | Object type: Scalar function | Computes the natural logarithm of the cumulative distribution function (CDF) of the non-central Student's t distribution. |
| dist_non_central_t_log_cdf_complement() | Object type: Scalar function | Computes the natural logarithm of the survival function of the non-central Student's t distribution, log P(X > x). |
| dist_non_central_t_log_pdf() | Object type: Scalar function | Computes the natural logarithm of the probability density function (PDF) of the non-central Student's t distribution at x. |
| dist_non_central_t_mean() | Object type: Scalar function | Returns the mean of the non-central Student's t distribution. |
| dist_non_central_t_median() | Object type: Scalar function | Returns the median of the non-central Student's t distribution. |
| dist_non_central_t_mode() | Object type: Scalar function | Returns the mode (most likely value) of the non-central Student's t distribution. |
| dist_non_central_t_pdf() | Object type: Scalar function | Computes the probability density function (PDF) of the non-central Student's t distribution at x. |
| dist_non_central_t_quantile() | Object type: Scalar function | Computes the quantile function (inverse CDF) of the non-central Student's t distribution. |
| dist_non_central_t_quantile_complement() | Object type: Scalar function | Computes the complementary quantile function of the non-central Student's t distribution. |
| dist_non_central_t_range() | Object type: Scalar function | Returns the range of the non-central Student's t distribution as [min, max]. |
| dist_non_central_t_sample() | Object type: Scalar function | Generates a random sample from the non-central Student's t distribution with the specified parameters. |
| dist_non_central_t_samples() | Object type: Scalar function | Generates a list of n random samples from the non-central Student's t distribution with the specified parameters. |
| dist_non_central_t_skewness() | Object type: Scalar function | Returns the skewness of the non-central Student's t distribution. |
| dist_non_central_t_stddev() | Object type: Scalar function | Returns the standard deviation of the non-central Student's t distribution. |
| dist_non_central_t_support() | Object type: Scalar function | Returns the support of the non-central Student's t distribution as [min, max]. |
| dist_non_central_t_variance() | Object type: Scalar function | Returns the variance of the non-central Student's t distribution. |
|
Normal
Normal (Gaussian) — the workhorse continuous distribution. Z-scores, confidence intervals, central limit applications. |
||
| dist_normal_cdf() | Object type: Scalar function | Computes the cumulative distribution function (CDF) of the normal distribution, P(X <= x). |
| dist_normal_cdf_complement() | Object type: Scalar function | Computes the complementary cumulative distribution function (survival function) of the normal distribution, P(X > x). |
| dist_normal_chf() | Object type: Scalar function | Computes the cumulative hazard function of the normal distribution at x. |
| dist_normal_fit() | Object type: Aggregate function | Fits a normal distribution to x by maximum likelihood. |
| dist_normal_hazard() | Object type: Scalar function | Computes the hazard function of the normal distribution at x. |
| dist_normal_ks_test() | Object type: Aggregate function | One-sample Kolmogorov-Smirnov test of whether x follows the normal distribution with the given parameters. |
| dist_normal_kurtosis() | Object type: Scalar function | Returns the kurtosis of the normal distribution. |
| dist_normal_kurtosis_excess() | Object type: Scalar function | Returns the excess kurtosis of the normal distribution. |
| dist_normal_log_cdf() | Object type: Scalar function | Computes the natural logarithm of the cumulative distribution function (CDF) of the normal distribution. |
| dist_normal_log_cdf_complement() | Object type: Scalar function | Computes the natural logarithm of the survival function of the normal distribution, log P(X > x). |
| dist_normal_log_pdf() | Object type: Scalar function | Computes the natural logarithm of the probability density function (PDF) of the normal distribution at x. |
| dist_normal_mean() | Object type: Scalar function | Returns the mean of the normal distribution. |
| dist_normal_median() | Object type: Scalar function | Returns the median of the normal distribution. |
| dist_normal_mode() | Object type: Scalar function | Returns the mode (most likely value) of the normal distribution. |
| dist_normal_pdf() | Object type: Scalar function | Computes the probability density function (PDF) of the normal distribution at x. |
| dist_normal_quantile() | Object type: Scalar function | Computes the quantile function (inverse CDF) of the normal distribution. |
| dist_normal_quantile_complement() | Object type: Scalar function | Computes the complementary quantile function of the normal distribution. |
| dist_normal_range() | Object type: Scalar function | Returns the range of the normal distribution as [min, max]. |
| dist_normal_sample() | Object type: Scalar function | Generates a random sample from the normal distribution with the specified parameters. |
| dist_normal_samples() | Object type: Scalar function | Generates a list of n random samples from the normal distribution with the specified parameters. |
| dist_normal_skewness() | Object type: Scalar function | Returns the skewness of the normal distribution. |
| dist_normal_stddev() | Object type: Scalar function | Returns the standard deviation of the normal distribution. |
| dist_normal_support() | Object type: Scalar function | Returns the support of the normal distribution as [min, max]. |
| dist_normal_variance() | Object type: Scalar function | Returns the variance of the normal distribution. |
|
Pareto
Pareto distribution — power-law tail with scale and shape. Wealth, file sizes, internet traffic; the 80/20 rule. |
||
| dist_pareto_cdf() | Object type: Scalar function |
Positional arguments are (scale, shape), both positive and finite.
|
| dist_pareto_cdf_complement() | Object type: Scalar function |
Positional arguments are (scale, shape), both positive and finite.
|
| dist_pareto_chf() | Object type: Scalar function |
Positional arguments are (scale, shape), both positive and finite.
|
| dist_pareto_fit() | Object type: Aggregate function | Fits a Pareto distribution to x by maximum likelihood. |
| dist_pareto_hazard() | Object type: Scalar function |
Positional arguments are (scale, shape), both positive and finite.
|
| dist_pareto_ks_test() | Object type: Aggregate function | One-sample Kolmogorov-Smirnov test of whether x follows the Pareto distribution with the given parameters. |
| dist_pareto_kurtosis() | Object type: Scalar function |
Positional arguments are (scale, shape), both positive and finite.
|
| dist_pareto_kurtosis_excess() | Object type: Scalar function |
Positional arguments are (scale, shape), both positive and finite.
|
| dist_pareto_log_cdf() | Object type: Scalar function |
Positional arguments are (scale, shape), both positive and finite.
|
| dist_pareto_log_cdf_complement() | Object type: Scalar function |
Positional arguments are (scale, shape), both positive and finite.
|
| dist_pareto_log_pdf() | Object type: Scalar function |
Positional arguments are (scale, shape), both positive and finite.
|
| dist_pareto_mean() | Object type: Scalar function |
Positional arguments are (scale, shape), both positive and finite.
|
| dist_pareto_median() | Object type: Scalar function |
Positional arguments are (scale, shape), both positive and finite.
|
| dist_pareto_mode() | Object type: Scalar function |
Positional arguments are (scale, shape), both positive and finite.
|
| dist_pareto_pdf() | Object type: Scalar function |
Positional arguments are (scale, shape), both positive and finite.
|
| dist_pareto_quantile() | Object type: Scalar function |
Positional arguments are (scale, shape), both positive and finite.
|
| dist_pareto_quantile_complement() | Object type: Scalar function |
Positional arguments are (scale, shape), both positive and finite.
|
| dist_pareto_range() | Object type: Scalar function |
Positional arguments are (scale, shape), both positive and finite.
|
| dist_pareto_sample() | Object type: Scalar function |
Positional arguments are (scale, shape), both positive and finite.
|
| dist_pareto_samples() | Object type: Scalar function | Generates a list of n random samples from the Pareto distribution with the specified parameters. |
| dist_pareto_skewness() | Object type: Scalar function |
Positional arguments are (scale, shape), both positive and finite.
|
| dist_pareto_stddev() | Object type: Scalar function |
Positional arguments are (scale, shape), both positive and finite.
|
| dist_pareto_support() | Object type: Scalar function |
Positional arguments are (scale, shape), both positive and finite.
|
| dist_pareto_variance() | Object type: Scalar function |
Positional arguments are (scale, shape), both positive and finite.
|
|
Poisson
Poisson — count of independent events in fixed interval at rate λ. Arrivals, defects, rare-event counts. |
||
| dist_poisson_cdf() | Object type: Scalar function | Computes the cumulative distribution function (CDF) of the Poisson distribution, P(X <= x). |
| dist_poisson_cdf_complement() | Object type: Scalar function | Computes the complementary cumulative distribution function (survival function) of the Poisson distribution, P(X > x). |
| dist_poisson_chf() | Object type: Scalar function | Computes the cumulative hazard function of the Poisson distribution at x. |
| dist_poisson_fit() | Object type: Aggregate function | Fits a Poisson distribution to x by maximum likelihood. |
| dist_poisson_hazard() | Object type: Scalar function | Computes the hazard function of the Poisson distribution at x. |
| dist_poisson_kurtosis() | Object type: Scalar function | Returns the kurtosis of the Poisson distribution. |
| dist_poisson_kurtosis_excess() | Object type: Scalar function | Returns the excess kurtosis of the Poisson distribution. |
| dist_poisson_log_cdf() | Object type: Scalar function | Computes the natural logarithm of the cumulative distribution function (CDF) of the Poisson distribution. |
| dist_poisson_log_cdf_complement() | Object type: Scalar function | Computes the natural logarithm of the survival function of the Poisson distribution, log P(X > x). |
| dist_poisson_log_pdf() | Object type: Scalar function | Computes the natural logarithm of the probability mass function (PMF) of the Poisson distribution at x. |
| dist_poisson_log_pmf() | Object type: Scalar function | Computes the natural logarithm of the probability mass function (PMF) of the Poisson distribution at x. |
| dist_poisson_mean() | Object type: Scalar function | Returns the mean of the Poisson distribution. |
| dist_poisson_median() | Object type: Scalar function | Returns the median of the Poisson distribution. |
| dist_poisson_mode() | Object type: Scalar function | Returns the mode (most likely value) of the Poisson distribution. |
| dist_poisson_pdf() | Object type: Scalar function | Computes the probability mass function (PMF) of the Poisson distribution at x. |
| dist_poisson_pmf() | Object type: Scalar function | Computes the probability mass function (PMF) of the Poisson distribution at x, P(X = x). |
| dist_poisson_quantile() | Object type: Scalar function | Computes the quantile function (inverse CDF) of the Poisson distribution. |
| dist_poisson_quantile_complement() | Object type: Scalar function | Computes the complementary quantile function of the Poisson distribution. |
| dist_poisson_range() | Object type: Scalar function | Returns the range of the Poisson distribution as [min, max]. |
| dist_poisson_sample() | Object type: Scalar function | Generates a random sample from the Poisson distribution with the specified parameters. |
| dist_poisson_samples() | Object type: Scalar function | Generates a list of n random samples from the Poisson distribution with the specified parameters. |
| dist_poisson_skewness() | Object type: Scalar function | Returns the skewness of the Poisson distribution. |
| dist_poisson_stddev() | Object type: Scalar function | Returns the standard deviation of the Poisson distribution. |
| dist_poisson_support() | Object type: Scalar function | Returns the support of the Poisson distribution as [min, max]. |
| dist_poisson_variance() | Object type: Scalar function | Returns the variance of the Poisson distribution. |
|
Rayleigh
Rayleigh distribution — magnitude of a 2D vector with i.i.d. Normal components. Wind speed, signal envelopes. |
||
| dist_rayleigh_cdf() | Object type: Scalar function | Computes the cumulative distribution function (CDF) of the Rayleigh distribution, P(X <= x). |
| dist_rayleigh_cdf_complement() | Object type: Scalar function | Computes the complementary cumulative distribution function (survival function) of the Rayleigh distribution, P(X > x). |
| dist_rayleigh_chf() | Object type: Scalar function | Computes the cumulative hazard function of the Rayleigh distribution at x. |
| dist_rayleigh_fit() | Object type: Aggregate function | Fits a Rayleigh distribution to x by maximum likelihood. |
| dist_rayleigh_hazard() | Object type: Scalar function | Computes the hazard function of the Rayleigh distribution at x. |
| dist_rayleigh_ks_test() | Object type: Aggregate function | One-sample Kolmogorov-Smirnov test of whether x follows the Rayleigh distribution with the given parameters. |
| dist_rayleigh_kurtosis() | Object type: Scalar function | Returns the kurtosis of the Rayleigh distribution. |
| dist_rayleigh_kurtosis_excess() | Object type: Scalar function | Returns the excess kurtosis of the Rayleigh distribution. |
| dist_rayleigh_log_cdf() | Object type: Scalar function | Computes the natural logarithm of the cumulative distribution function (CDF) of the Rayleigh distribution. |
| dist_rayleigh_log_cdf_complement() | Object type: Scalar function | Computes the natural logarithm of the survival function of the Rayleigh distribution, log P(X > x). |
| dist_rayleigh_log_pdf() | Object type: Scalar function | Computes the natural logarithm of the probability density function (PDF) of the Rayleigh distribution at x. |
| dist_rayleigh_mean() | Object type: Scalar function | Returns the mean of the Rayleigh distribution. |
| dist_rayleigh_median() | Object type: Scalar function | Returns the median of the Rayleigh distribution. |
| dist_rayleigh_mode() | Object type: Scalar function | Returns the mode (most likely value) of the Rayleigh distribution. |
| dist_rayleigh_pdf() | Object type: Scalar function | Computes the probability density function (PDF) of the Rayleigh distribution at x. |
| dist_rayleigh_quantile() | Object type: Scalar function | Computes the quantile function (inverse CDF) of the Rayleigh distribution. |
| dist_rayleigh_quantile_complement() | Object type: Scalar function | Computes the complementary quantile function of the Rayleigh distribution. |
| dist_rayleigh_range() | Object type: Scalar function | Returns the range of the Rayleigh distribution as [min, max]. |
| dist_rayleigh_sample() | Object type: Scalar function | Generates a random sample from the Rayleigh distribution with the specified parameters. |
| dist_rayleigh_samples() | Object type: Scalar function | Generates a list of n random samples from the Rayleigh distribution with the specified parameters. |
| dist_rayleigh_skewness() | Object type: Scalar function | Returns the skewness of the Rayleigh distribution. |
| dist_rayleigh_stddev() | Object type: Scalar function | Returns the standard deviation of the Rayleigh distribution. |
| dist_rayleigh_support() | Object type: Scalar function | Returns the support of the Rayleigh distribution as [min, max]. |
| dist_rayleigh_variance() | Object type: Scalar function | Returns the variance of the Rayleigh distribution. |
|
Skew Normal
Skew normal — Normal with a shape parameter that adds asymmetry. Skewed measurements that are otherwise bell-shaped. |
||
| dist_skew_normal_cdf() | Object type: Scalar function | Computes the cumulative distribution function (CDF) of the skew normal distribution, P(X <= x). |
| dist_skew_normal_cdf_complement() | Object type: Scalar function | Computes the complementary cumulative distribution function (survival function) of the skew normal distribution, P(X > x). |
| dist_skew_normal_chf() | Object type: Scalar function | Computes the cumulative hazard function of the skew normal distribution at x. |
| dist_skew_normal_hazard() | Object type: Scalar function | Computes the hazard function of the skew normal distribution at x. |
| dist_skew_normal_ks_test() | Object type: Aggregate function | One-sample Kolmogorov-Smirnov test of whether x follows the skew normal distribution with the given parameters. |
| dist_skew_normal_kurtosis() | Object type: Scalar function | Returns the kurtosis of the skew normal distribution. |
| dist_skew_normal_kurtosis_excess() | Object type: Scalar function | Returns the excess kurtosis of the skew normal distribution. |
| dist_skew_normal_log_cdf() | Object type: Scalar function | Computes the natural logarithm of the cumulative distribution function (CDF) of the skew normal distribution. |
| dist_skew_normal_log_cdf_complement() | Object type: Scalar function | Computes the natural logarithm of the survival function of the skew normal distribution, log P(X > x). |
| dist_skew_normal_log_pdf() | Object type: Scalar function | Computes the natural logarithm of the probability density function (PDF) of the skew normal distribution at x. |
| dist_skew_normal_mean() | Object type: Scalar function | Returns the mean of the skew normal distribution. |
| dist_skew_normal_median() | Object type: Scalar function | Returns the median of the skew normal distribution. |
| dist_skew_normal_mode() | Object type: Scalar function | Returns the mode (most likely value) of the skew normal distribution. |
| dist_skew_normal_pdf() | Object type: Scalar function | Computes the probability density function (PDF) of the skew normal distribution at x. |
| dist_skew_normal_quantile() | Object type: Scalar function | Computes the quantile function (inverse CDF) of the skew normal distribution. |
| dist_skew_normal_quantile_complement() | Object type: Scalar function | Computes the complementary quantile function of the skew normal distribution. |
| dist_skew_normal_range() | Object type: Scalar function | Returns the range of the skew normal distribution as [min, max]. |
| dist_skew_normal_sample() | Object type: Scalar function | Generates a random sample from the skew normal distribution with the specified parameters. |
| dist_skew_normal_samples() | Object type: Scalar function | Generates a list of n random samples from the skew normal distribution with the specified parameters. |
| dist_skew_normal_skewness() | Object type: Scalar function | Returns the skewness of the skew normal distribution. |
| dist_skew_normal_stddev() | Object type: Scalar function | Returns the standard deviation of the skew normal distribution. |
| dist_skew_normal_support() | Object type: Scalar function | Returns the support of the skew normal distribution as [min, max]. |
| dist_skew_normal_variance() | Object type: Scalar function | Returns the variance of the skew normal distribution. |
|
Student's t
Student's t — heavier-tailed alternative to Normal, parameterized by degrees of freedom. Small-sample inference. |
||
| dist_students_t_cdf() | Object type: Scalar function | Computes the cumulative distribution function (CDF) of the Student's t distribution, P(X <= x). |
| dist_students_t_cdf_complement() | Object type: Scalar function | Computes the complementary cumulative distribution function (survival function) of the Student's t distribution, P(X > x). |
| dist_students_t_chf() | Object type: Scalar function | Computes the cumulative hazard function of the Student's t distribution at x. |
| dist_students_t_fit() | Object type: Aggregate function | Fits a standard Student's t distribution to x by maximum likelihood (golden section search). |
| dist_students_t_hazard() | Object type: Scalar function | Computes the hazard function of the Student's t distribution at x. |
| dist_students_t_ks_test() | Object type: Aggregate function | One-sample Kolmogorov-Smirnov test of whether x follows the Student's t distribution with the given parameters. |
| dist_students_t_kurtosis() | Object type: Scalar function | Returns the kurtosis of the Student's t distribution. |
| dist_students_t_kurtosis_excess() | Object type: Scalar function | Returns the excess kurtosis of the Student's t distribution. |
| dist_students_t_log_cdf() | Object type: Scalar function | Computes the natural logarithm of the cumulative distribution function (CDF) of the Student's t distribution. |
| dist_students_t_log_cdf_complement() | Object type: Scalar function | Computes the natural logarithm of the survival function of the Student's t distribution, log P(X > x). |
| dist_students_t_log_pdf() | Object type: Scalar function | Computes the natural logarithm of the probability density function (PDF) of the Student's t distribution at x. |
| dist_students_t_mean() | Object type: Scalar function | Returns the mean of the Student's t distribution. |
| dist_students_t_median() | Object type: Scalar function | Returns the median of the Student's t distribution. |
| dist_students_t_mode() | Object type: Scalar function | Returns the mode (most likely value) of the Student's t distribution. |
| dist_students_t_pdf() | Object type: Scalar function | Computes the probability density function (PDF) of the Student's t distribution at x. |
| dist_students_t_quantile() | Object type: Scalar function | Computes the quantile function (inverse CDF) of the Student's t distribution. |
| dist_students_t_quantile_complement() | Object type: Scalar function | Computes the complementary quantile function of the Student's t distribution. |
| dist_students_t_range() | Object type: Scalar function | Returns the range of the Student's t distribution as [min, max]. |
| dist_students_t_sample() | Object type: Scalar function | Generates a random sample from the Student's t distribution with the specified parameters. |
| dist_students_t_samples() | Object type: Scalar function | Generates a list of n random samples from the Student's t distribution with the specified parameters. |
| dist_students_t_skewness() | Object type: Scalar function | Returns the skewness of the Student's t distribution. |
| dist_students_t_stddev() | Object type: Scalar function | Returns the standard deviation of the Student's t distribution. |
| dist_students_t_support() | Object type: Scalar function | Returns the support of the Student's t distribution as [min, max]. |
| dist_students_t_variance() | Object type: Scalar function | Returns the variance of the Student's t distribution. |
|
Triangular
Triangular on [lower, upper] with a mode — a simple prior from minimum, most likely and maximum estimates. PERT-style estimates. |
||
| dist_triangular_cdf() | Object type: Scalar function | Computes the cumulative distribution function (CDF) of the triangular distribution, P(X <= x). |
| dist_triangular_cdf_complement() | Object type: Scalar function | Computes the complementary cumulative distribution function (survival function) of the triangular distribution, P(X > x). |
| dist_triangular_chf() | Object type: Scalar function | Computes the cumulative hazard function of the triangular distribution at x. |
| dist_triangular_hazard() | Object type: Scalar function | Computes the hazard function of the triangular distribution at x. |
| dist_triangular_ks_test() | Object type: Aggregate function | One-sample Kolmogorov-Smirnov test of whether x follows the triangular distribution with the given parameters. |
| dist_triangular_kurtosis() | Object type: Scalar function | Returns the kurtosis of the triangular distribution. |
| dist_triangular_kurtosis_excess() | Object type: Scalar function | Returns the excess kurtosis of the triangular distribution. |
| dist_triangular_log_cdf() | Object type: Scalar function | Computes the natural logarithm of the cumulative distribution function (CDF) of the triangular distribution. |
| dist_triangular_log_cdf_complement() | Object type: Scalar function | Computes the natural logarithm of the survival function of the triangular distribution, log P(X > x). |
| dist_triangular_log_pdf() | Object type: Scalar function | Computes the natural logarithm of the probability density function (PDF) of the triangular distribution at x. |
| dist_triangular_mean() | Object type: Scalar function | Returns the mean of the triangular distribution. |
| dist_triangular_median() | Object type: Scalar function | Returns the median of the triangular distribution. |
| dist_triangular_mode() | Object type: Scalar function | Returns the mode (most likely value) of the triangular distribution. |
| dist_triangular_pdf() | Object type: Scalar function | Computes the probability density function (PDF) of the triangular distribution at x. |
| dist_triangular_quantile() | Object type: Scalar function | Computes the quantile function (inverse CDF) of the triangular distribution. |
| dist_triangular_quantile_complement() | Object type: Scalar function | Computes the complementary quantile function of the triangular distribution. |
| dist_triangular_range() | Object type: Scalar function | Returns the range of the triangular distribution as [min, max]. |
| dist_triangular_sample() | Object type: Scalar function | Generates a random sample from the triangular distribution with the specified parameters. |
| dist_triangular_samples() | Object type: Scalar function | Generates a list of n random samples from the triangular distribution with the specified parameters. |
| dist_triangular_skewness() | Object type: Scalar function | Returns the skewness of the triangular distribution. |
| dist_triangular_stddev() | Object type: Scalar function | Returns the standard deviation of the triangular distribution. |
| dist_triangular_support() | Object type: Scalar function | Returns the support of the triangular distribution as [min, max]. |
| dist_triangular_variance() | Object type: Scalar function | Returns the variance of the triangular distribution. |
|
Uniform (Integer)
Discrete uniform — every integer in [min, max] equally likely. Random index sampling, dice rolls. |
||
| dist_uniform_int_cdf() | Object type: Scalar function |
P(X <= x) for the inclusive integer support [min, max].
|
| dist_uniform_int_cdf_complement() | Object type: Scalar function | P(X > x) for the inclusive integer support, computed directly for the upper tail. |
| dist_uniform_int_chf() | Object type: Scalar function |
Cumulative hazard -ln(P(X > x)).
|
| dist_uniform_int_hazard() | Object type: Scalar function | Discrete hazard P(X = x) / P(X >= x). |
| dist_uniform_int_kurtosis() | Object type: Scalar function | Kurtosis of the inclusive discrete uniform distribution. |
| dist_uniform_int_kurtosis_excess() | Object type: Scalar function | Excess kurtosis of the inclusive discrete uniform distribution. |
| dist_uniform_int_log_cdf() | Object type: Scalar function | Computes the natural logarithm of the cumulative distribution function (CDF) of the discrete uniform distribution. |
| dist_uniform_int_log_cdf_complement() | Object type: Scalar function | Computes the natural logarithm of the survival function of the discrete uniform distribution, log P(X > x). |
| dist_uniform_int_log_pdf() | Object type: Scalar function | Natural logarithm of the discrete probability mass. |
| dist_uniform_int_log_pmf() | Object type: Scalar function | Computes the natural logarithm of the probability mass function (PMF) of the discrete uniform distribution. |
| dist_uniform_int_mean() | Object type: Scalar function |
Mean of the inclusive discrete uniform distribution: (min + max) / 2, returned as DOUBLE.
|
| dist_uniform_int_median() | Object type: Scalar function |
Midpoint (min + max) / 2, returned as DOUBLE.
|
| dist_uniform_int_mode() | Object type: Scalar function | Returns min as a representative mode. |
| dist_uniform_int_pdf() | Object type: Scalar function |
Probability mass P(X = x) on the inclusive integer support [min, max]: 1 / (max - min + 1) inside the support and 0 outside.
|
| dist_uniform_int_pmf() | Object type: Scalar function | Computes the probability mass function (PMF) of the discrete uniform distribution, P(X = x) on the inclusive integer support [min, max]. |
| dist_uniform_int_quantile() | Object type: Scalar function | Smallest supported integer whose CDF is at least p. |
| dist_uniform_int_quantile_complement() | Object type: Scalar function | Smallest supported integer whose upper-tail probability P(X > x) is at most p. |
| dist_uniform_int_range() | Object type: Scalar function | Returns the range of the discrete uniform distribution as [min, max]. |
| dist_uniform_int_sample() | Object type: Scalar function | Generates a random sample from the discrete uniform distribution with the specified parameters. |
| dist_uniform_int_samples() | Object type: Scalar function | Generates a list of n random samples from the discrete uniform distribution with the specified parameters. |
| dist_uniform_int_skewness() | Object type: Scalar function | Returns 0 for a nondegenerate discrete uniform distribution. |
| dist_uniform_int_stddev() | Object type: Scalar function | Square root of the discrete uniform variance, returned as DOUBLE. |
| dist_uniform_int_support() | Object type: Scalar function | Returns the support of the discrete uniform distribution as [min, max]. |
| dist_uniform_int_variance() | Object type: Scalar function |
Variance of the inclusive discrete uniform distribution: ((max - min + 1)^2 - 1) / 12, returned as DOUBLE.
|
|
Uniform (Real)
Continuous uniform on [min, max]. The default sampling distribution and a building block for inverse-transform sampling. |
||
| dist_uniform_real_cdf() | Object type: Scalar function | Computes the cumulative distribution function (CDF) of the continuous uniform distribution, P(X <= x). |
| dist_uniform_real_cdf_complement() | Object type: Scalar function | Computes the complementary cumulative distribution function (survival function) of the continuous uniform distribution, P(X > x). |
| dist_uniform_real_chf() | Object type: Scalar function | Computes the cumulative hazard function of the continuous uniform distribution at x. |
| dist_uniform_real_fit() | Object type: Aggregate function | Fits a continuous uniform distribution to x by maximum likelihood (the sample minimum and maximum). |
| dist_uniform_real_hazard() | Object type: Scalar function | Computes the hazard function of the continuous uniform distribution at x. |
| dist_uniform_real_ks_test() | Object type: Aggregate function | One-sample Kolmogorov-Smirnov test of whether x follows the continuous uniform distribution with the given parameters. |
| dist_uniform_real_kurtosis() | Object type: Scalar function | Returns the kurtosis of the continuous uniform distribution. |
| dist_uniform_real_kurtosis_excess() | Object type: Scalar function | Returns the excess kurtosis of the continuous uniform distribution. |
| dist_uniform_real_log_cdf() | Object type: Scalar function | Computes the natural logarithm of the cumulative distribution function (CDF) of the continuous uniform distribution. |
| dist_uniform_real_log_cdf_complement() | Object type: Scalar function | Computes the natural logarithm of the survival function of the continuous uniform distribution, log P(X > x). |
| dist_uniform_real_log_pdf() | Object type: Scalar function | Computes the natural logarithm of the probability density function (PDF) of the continuous uniform distribution at x. |
| dist_uniform_real_mean() | Object type: Scalar function | Returns the mean of the continuous uniform distribution. |
| dist_uniform_real_median() | Object type: Scalar function | Returns the median of the continuous uniform distribution. |
| dist_uniform_real_mode() | Object type: Scalar function | Returns the mode (most likely value) of the continuous uniform distribution. |
| dist_uniform_real_pdf() | Object type: Scalar function | Computes the probability density function (PDF) of the continuous uniform distribution at x. |
| dist_uniform_real_quantile() | Object type: Scalar function | Computes the quantile function (inverse CDF) of the continuous uniform distribution. |
| dist_uniform_real_quantile_complement() | Object type: Scalar function | Computes the complementary quantile function of the continuous uniform distribution. |
| dist_uniform_real_range() | Object type: Scalar function | Returns the range of the continuous uniform distribution as [min, max]. |
| dist_uniform_real_sample() | Object type: Scalar function | Generates a random sample from the continuous uniform distribution with the specified parameters. |
| dist_uniform_real_samples() | Object type: Scalar function | Generates a list of n random samples from the continuous uniform distribution with the specified parameters. |
| dist_uniform_real_skewness() | Object type: Scalar function | Returns the skewness of the continuous uniform distribution. |
| dist_uniform_real_stddev() | Object type: Scalar function | Returns the standard deviation of the continuous uniform distribution. |
| dist_uniform_real_support() | Object type: Scalar function | Returns the support of the continuous uniform distribution as [min, max]. |
| dist_uniform_real_variance() | Object type: Scalar function | Returns the variance of the continuous uniform distribution. |
|
Weibull
Weibull distribution — flexible shape/scale. Reliability engineering, time-to-failure, wind-speed modeling. |
||
| dist_weibull_cdf() | Object type: Scalar function | Computes the cumulative distribution function (CDF) of the Weibull distribution, P(X <= x). |
| dist_weibull_cdf_complement() | Object type: Scalar function | Computes the complementary cumulative distribution function (survival function) of the Weibull distribution, P(X > x). |
| dist_weibull_chf() | Object type: Scalar function | Computes the cumulative hazard function of the Weibull distribution at x. |
| dist_weibull_fit() | Object type: Aggregate function | Fits a Weibull distribution to x by maximum likelihood (Newton's method). |
| dist_weibull_hazard() | Object type: Scalar function | Computes the hazard function of the Weibull distribution at x. |
| dist_weibull_ks_test() | Object type: Aggregate function | One-sample Kolmogorov-Smirnov test of whether x follows the Weibull distribution with the given parameters. |
| dist_weibull_kurtosis() | Object type: Scalar function | Returns the kurtosis of the Weibull distribution. |
| dist_weibull_kurtosis_excess() | Object type: Scalar function | Returns the excess kurtosis of the Weibull distribution. |
| dist_weibull_log_cdf() | Object type: Scalar function | Computes the natural logarithm of the cumulative distribution function (CDF) of the Weibull distribution. |
| dist_weibull_log_cdf_complement() | Object type: Scalar function | Computes the natural logarithm of the survival function of the Weibull distribution, log P(X > x). |
| dist_weibull_log_pdf() | Object type: Scalar function | Computes the natural logarithm of the probability density function (PDF) of the Weibull distribution at x. |
| dist_weibull_mean() | Object type: Scalar function | Returns the mean of the Weibull distribution. |
| dist_weibull_median() | Object type: Scalar function | Returns the median of the Weibull distribution. |
| dist_weibull_mode() | Object type: Scalar function | Returns the mode (most likely value) of the Weibull distribution. |
| dist_weibull_pdf() | Object type: Scalar function | Computes the probability density function (PDF) of the Weibull distribution at x. |
| dist_weibull_quantile() | Object type: Scalar function | Computes the quantile function (inverse CDF) of the Weibull distribution. |
| dist_weibull_quantile_complement() | Object type: Scalar function | Computes the complementary quantile function of the Weibull distribution. |
| dist_weibull_range() | Object type: Scalar function | Returns the range of the Weibull distribution as [min, max]. |
| dist_weibull_sample() | Object type: Scalar function | Generates a random sample from the Weibull distribution with the specified parameters. |
| dist_weibull_samples() | Object type: Scalar function | Generates a list of n random samples from the Weibull distribution with the specified parameters. |
| dist_weibull_skewness() | Object type: Scalar function | Returns the skewness of the Weibull distribution. |
| dist_weibull_stddev() | Object type: Scalar function | Returns the standard deviation of the Weibull distribution. |
| dist_weibull_support() | Object type: Scalar function | Returns the support of the Weibull distribution as [min, max]. |
| dist_weibull_variance() | Object type: Scalar function | Returns the variance of the Weibull distribution. |
No extension contents match that search.
API Reference
Function Reference
Practical Examples
Cookbook
Real-world recipes and patterns for common use cases.
Recipes are organized by task and distribution family. Every univariate distribution exposes the same operations — sample / samples, pdf / log_pdf (and pmf for discrete ones), cdf / log_cdf / cdf_complement, quantile, plus property functions (mean, variance, skewness, …). Once you’ve used one family, the rest follow the same shape. Fitting and hypothesis tests are aggregates.
Normal — the workhorse
Z-scores, confidence intervals, two-sided p-values, VaR. The Normal distribution is parameterized by mean and standard deviation:
-- Quantiles, density, CDFSELECT dist_normal_quantile(0.0, 1.0, 0.95) AS p95; -- 1.6449SELECT dist_normal_pdf(0.0, 1.0, 0.5) AS density;SELECT dist_normal_cdf(0.0, 1.0, 1.96) AS prob; -- ~0.975-- Z-score using property functions inlineSELECT height_cm, (height_cm - dist_normal_mean(100, 15)) / dist_normal_stddev(100, 15) AS height_zscoreFROM (VALUES (92), (100), (115)) observations(height_cm);-- Two-sided p-value from a Z-statisticWITH z AS (SELECT 2.31 AS stat)SELECT 2 * dist_normal_cdf_complement(0.0, 1.0, ABS(stat)) AS p_valueFROM z;See dist_normal_pdf, dist_normal_cdf, dist_normal_quantile, dist_normal_sample.
Discrete counts — Binomial and Poisson
Binomial for fixed-trial successes; Poisson for events at a rate:
-- Binomial: P(X = 7), P(X ≤ 5), random kSELECT dist_binomial_pdf(10, 0.3, 7) AS prob_exactly_7;SELECT dist_binomial_cdf(10, 0.3, 5) AS prob_at_most_5;SELECT dist_binomial_sample(10, 0.3) AS k;-- Poisson: probability of seeing >= 5 arrivals when λ=2.5SELECT dist_poisson_cdf_complement(2.5, 4) AS prob_5_or_more;-- Poisson sample for synthetic event-count columnsSELECT i, dist_poisson_sample(2.5) AS arrivalsFROM range(10) t(i);See dist_binomial_pdf, dist_binomial_cdf, dist_poisson_cdf, dist_poisson_sample.
Time-to-event — Exponential, Weibull, Gamma
Exponential for memoryless waiting times; Weibull for time-to-failure with non-constant hazard; Gamma for waiting times across multiple events:
-- Survival probability past t=2 for Exponential(rate=0.5)SELECT dist_exponential_cdf_complement(0.5, 2.0) AS surviving;-- Hazard rate at t=10 for Weibull(shape=1.5, scale=8)SELECT dist_weibull_hazard(1.5, 8.0, 10.0) AS instantaneous_hazard;-- Sample 1,000 service times from Gamma(2, 3)SELECT dist_gamma_sample(2.0, 3.0) AS service_secsFROM range(1000);See dist_exponential_cdf_complement, dist_weibull_hazard, dist_gamma_sample.
Bayesian conjugates — Beta and Gamma priors
Closed-form conjugate posteriors are one quantile call away. After observing 17 successes in 25 trials with a Beta(2, 2) prior, the posterior is Beta(19, 10):
-- Posterior mean and 95% credible intervalSELECT dist_beta_mean(19, 10) AS posterior_mean, dist_beta_quantile(19, 10, 0.025) AS ci_lo, dist_beta_quantile(19, 10, 0.975) AS ci_hi;See dist_beta_mean, dist_beta_quantile.
Fit a distribution, then test the fit
dist_<name>_fit estimates parameters from a column by maximum likelihood. Its fields are named like the distribution’s parameters, so the fitted values feed straight into the other functions:
WITH durations AS ( SELECT * FROM (VALUES (1.2), (0.7), (2.9), (1.8), (0.4), (3.6), (1.1), (2.2)) t(x)), fit AS ( SELECT dist_gamma_fit(x) AS f FROM durations)SELECT f.shape, f.scale, dist_gamma_quantile(f.shape, f.scale, 0.95) AS p95_duration, dist_gamma_ks_test(x, f.shape, f.scale).p_value AS ks_p_valueFROM durations, fitGROUP BY f;Fits and tests are ordinary aggregates, so they work per group:
SELECT region, dist_poisson_fit(orders).rate AS orders_per_dayFROM (VALUES ('north', 4), ('north', 6), ('north', 5), ('south', 9), ('south', 7), ('south', 11)) t(region, orders)GROUP BY regionORDER BY region;Every fit also reports log_likelihood, aic and bic. To compare candidates on the same column, dist_fits runs them over one scan and ranks them by AICc, the AIC corrected for small samples:
WITH durations AS ( SELECT * FROM (VALUES (1.2), (0.7), (2.9), (1.8), (0.4), (3.6), (1.1), (2.2), (5.3), (0.9)) t(x))SELECT f.distribution, round(f.aicc, 2) AS aicc, round(f.delta_aicc, 2) AS delta_aicc, round(f.aicc_weight, 3) AS aicc_weightFROM ( SELECT unnest(dist_fits(x, ['gamma', 'lognormal', 'weibull', 'exponential'])) AS f FROM durations);Leave out the list to try every continuous fit. A candidate that can’t fit the sample comes last, with the reason in note.
See dist_fits, dist_gamma_fit, dist_gamma_ks_test, dist_poisson_fit, dist_weibull_fit.
Hypothesis tests
The test aggregates compute the statistic and p-value from your rows:
-- Welch's t-test: did the treated group (1) differ from control (0)?SELECT welch_t_test(x, grp) AS resultFROM (VALUES (5.1, 0), (4.8, 0), (5.6, 0), (5.0, 0), (6.2, 1), (5.9, 1), (7.1, 1), (6.4, 1)) t(x, grp);-- One-sample t-test against a target mean of 5SELECT one_sample_t_test(x, 5.0).p_value AS p_valueFROM (VALUES (5.1), (4.8), (5.6), (5.0), (5.4), (5.3)) t(x);-- Chi-squared goodness of fit: expected values may be counts or proportionsSELECT chi_squared_test(observed, expected) AS resultFROM (VALUES (18, 0.2), (22, 0.2), (31, 0.3), (29, 0.3)) t(observed, expected);-- Kolmogorov-Smirnov: do these values look standard normal?SELECT dist_normal_ks_test(x, 0.0, 1.0) AS ksFROM (VALUES (-1.2), (0.3), (0.8), (-0.4), (1.9), (0.1), (-0.7), (0.5)) t(x);When you already have a statistic, the CDF complement gives the p-value directly:
-- Two-sided t-test p-value, df=29WITH t AS (SELECT 2.045 AS stat, 29 AS df)SELECT 2 * dist_students_t_cdf_complement(df, ABS(stat)) AS p_valueFROM t;-- F-test (ANOVA) p-value, df1=3 df2=20WITH f AS (SELECT 4.94 AS stat)SELECT dist_fisher_f_cdf_complement(3, 20, stat) AS p_valueFROM f;See welch_t_test, one_sample_t_test, chi_squared_test, dist_normal_ks_test, dist_students_t_cdf_complement.
Power analysis — the non-central family
The non-central distributions describe a test statistic when the null hypothesis is false, which is what power calculations need:
-- Power of a one-sided t-test (df=20) when the true effect gives a non-centrality of 2.5SELECT dist_non_central_t_cdf_complement(20.0, 2.5, dist_students_t_quantile(20.0, 0.95)) AS power;-- Power of an ANOVA F-test (df1=3, df2=20) at non-centrality 8SELECT dist_non_central_f_cdf_complement(3.0, 20.0, 8.0, dist_fisher_f_quantile(3.0, 20.0, 0.95)) AS power;See dist_non_central_t_cdf_complement, dist_non_central_f_cdf_complement.
Heavy-tailed families — Pareto, Cauchy, Log-normal
Wealth, file sizes, internet traffic, financial returns. The tail dominates; reach for these when the Normal underestimates extremes:
-- Probability a file exceeds 1 GB under Pareto(scale=10MB, shape=1.5)SELECT dist_pareto_cdf_complement(10.0, 1.5, 1024.0) AS prob_over_1gb;-- Median income under Log-normal(meanlog=10.5, sdlog=0.7)SELECT dist_lognormal_median(10.5, 0.7) AS median_income;See dist_pareto_cdf_complement, dist_lognormal_median.
Synthetic data — combine families per column
Sampling functions return one draw per call, so combine them with range() over any source row count:
CREATE TABLE synthetic_users ASSELECT i AS user_id, dist_normal_sample(170, 8) AS height_cm, dist_lognormal_sample(10.5, 0.7) AS annual_income, dist_poisson_sample(3.5) AS sessions_last_week, dist_exponential_sample(0.1) AS avg_session_minutes, dist_bernoulli_sample(0.12) AS convertedFROM range(100000) t(i);One query, 100k rows of realistic-looking fixture data — heights from a Normal, incomes from a Log-normal, session counts from a Poisson, conversions from a Bernoulli.
Lists of samples
_samples(params..., n) returns n draws as one list, which suits per-row simulations:
-- 1,000 simulated daily demands per product, summarized per rowSELECT product, list_avg(d) AS mean_demand, list_max(d) AS worst_dayFROM ( SELECT product, dist_poisson_samples(rate, 1000) AS d FROM (VALUES ('widget', 4.0), ('gadget', 12.5)) t(product, rate))ORDER BY product;Multivariate — Dirichlet and multinomial
The Dirichlet samples probability vectors and the multinomial samples category counts. Both take and return lists:
-- Random market shares around 20% / 30% / 50%SELECT dist_dirichlet_sample([20.0, 30.0, 50.0]) AS shares;-- 100 visitors split across three landing pagesSELECT dist_multinomial_sample(100, [0.2, 0.3, 0.5]) AS visits, dist_multinomial_pmf(10, [0.2, 0.3, 0.5], [2, 3, 5]) AS prob_of_2_3_5;See dist_dirichlet_sample, dist_multinomial_sample, dist_multinomial_pmf.
Monte Carlo — the canonical example
-- Estimate π by sampling uniform points in [-1,1]² and counting hits inside the unit circleWITH samples AS ( SELECT dist_uniform_real_sample(-1.0, 1.0) AS x, dist_uniform_real_sample(-1.0, 1.0) AS y FROM range(1000000))SELECT 4.0 * COUNT(*) FILTER (WHERE x*x + y*y <= 1) / COUNT(*) AS pi_estimateFROM samples;The same pattern — generate, filter, aggregate — handles VaR, payoff integration, queueing simulation, A/B-test power calculations.
Value at Risk
-- 1-day 99% VaR assuming Normal returnsWITH params AS (SELECT 0.0001 AS mu, 0.02 AS sigma, 1000000 AS portfolio)SELECT portfolio * (-dist_normal_quantile(mu, sigma, 0.01)) AS var_99FROM params;For heavy-tailed VaR, swap dist_normal_quantile for dist_students_t_quantile with a low df.
Log-scale variants for likelihoods
Every PDF / CDF / CDF-complement has a _log_* variant. Use them inside likelihood computations and to avoid underflow on tiny tails:
-- Log-likelihood of one observation under N(0,1)SELECT dist_normal_log_pdf(0.0, 1.0, 4.5) AS log_density;-- Log-survival for very small tail probabilitiesSELECT dist_normal_log_cdf_complement(0.0, 1.0, 6.0) AS log_tail;See dist_normal_log_pdf, dist_normal_log_cdf_complement.
Reproducibility
Sampling uses DuckDB’s per-connection random engine, so setseed makes the following samples reproducible — including in parallel:
SELECT setseed(0.42);CREATE TABLE draws ASSELECT i, dist_normal_sample(0, 1) AS zFROM range(1000000) t(i);Running the same pair again produces the same table. To share exactly the same draws across sessions or tools, keep the materialized table.
Platform Support
Compatibility
Extension availability may vary by platform and DuckDB version. Check below to ensure this extension supports your environment before installation.
Quick Facts
Platforms
DuckDB 2.0.0
- Linux x86_64aarch64
- Linux (musl) Not available
- macOS Apple Silicon
- Windows x86_64x86_64 (MinGW)
- WASM Not available
Compiled binary sizes
| Platform | Architecture | Size |
|---|---|---|
| Linux | x86_64 | 5.83 MB |
| Linux | aarch64 | 4.87 MB |
| macOS | Apple Silicon | 4.77 MB |
| Windows | x86_64 | 11.46 MB |
| Windows | x86_64 (MinGW) | 19.64 MB |
Compressed download sizes for the release shown above.
DuckDB & Haybarn
Release calendar- DuckDB v2.0.0 Query.Farm repository Supported
- Haybarn v1.5.6 Built-in community repository Supported
Browser examples use Haybarn-Wasm 2.0.0-rc12.
Checked .