Skip to content

Stochastic

Monte Carlo, synthetic data, and what-if analysis directly in SQL.

641,105
extension loads · last 90 days
On this page

Technical Overview

22 distributions, callable from a SELECT

What it is

How it works

  • Vectorized scalar execution: Every function is a scalar that runs column-at-a-time over DuckDB's columnar engine. A million sampling calls inside a SELECT is one vectorized scan, not a Python loop — so Monte Carlo over range(N) stays fast.
  • Strict input validation: Illegal parameters (a negative standard deviation, a probability above 1) raise a SQL error rather than silently returning NaN, so a typo in a long pipeline fails fast instead of quietly poisoning every downstream value.

Scope and honest caveats

  • Univariate only: No copula or multivariate-normal sampler. For correlated draws, sample independently and apply a Cholesky-style transform yourself.
  • RNG seeding is not user-controlled: There is no documented per-query seed. For exactly-reproducible runs, generate the draws once into a table and treat that table as the seed.
  • No fitting or inference helpers: One-way: parameters → distribution. No MLE / method-of-moments fitters, no built-in tests. Compute the test statistic in SQL and call the appropriate CDF complement for the p-value.
  • Large simulations may want a notebook: For large-scale agent-based simulation, MCMC, or SciPy-grade fitting, keep a Python notebook. Stochastic shines for analyses that live next to warehouse data.

Deep Dive

Technical Details

Install

INSTALL stochastic FROM community;
LOAD stochastic;

Quick Start

Find the 95th percentile of a Normal(0, 1)

SELECT dist_normal_quantile(0.0, 1.0, 0.95) AS p95;

1,000 random draws from N(100, 15)

SELECT dist_normal_sample(100.0, 15.0) AS x
FROM range(1000);

P(X ≤ 5 | Binomial(n=10, p=0.3))

SELECT dist_binomial_cdf(10, 0.3, 5) AS prob_at_most_5;

Reference

Extension Contents

Quick reference to all available functions and settings organized by category.

Name Description
Bernoulli
dist_bernoulli_cdf() Computes the cumulative distribution function (CDF) of the bernoulli distribution.
dist_bernoulli_cdf_complement() Computes the complementary cumulative distribution function (1 - CDF) of the bernoulli distribution.
dist_bernoulli_chf() Computes the cumulative hazard function of the bernoulli distribution.
dist_bernoulli_hazard() Computes the hazard function of the bernoulli distribution.
dist_bernoulli_kurtosis() Returns the kurtosis of the bernoulli distribution.
dist_bernoulli_kurtosis_excess() Returns the excess kurtosis of the bernoulli distribution.
dist_bernoulli_log_cdf() Computes the natural logarithm of the cumulative distribution function (CDF) of the bernoulli distribution.
dist_bernoulli_log_cdf_complement() Computes the natural logarithm of the complementary cumulative distribution function (1 - CDF) of the bernoulli distribution.
dist_bernoulli_log_pdf() Computes the natural logarithm of the probability density function (log-PDF) of the bernoulli distribution.
dist_bernoulli_mean() Returns the mean (μ) of the bernoulli distribution, which is the first moment.
dist_bernoulli_median() Returns the median (50th percentile) of the bernoulli distribution, which equals the mean.
dist_bernoulli_mode() Returns the mode (most likely value) of the bernoulli distribution, which equals the mean.
dist_bernoulli_pdf() Computes the probability density function (PDF) of the bernoulli distribution.
dist_bernoulli_quantile() Computes the quantile function (inverse CDF) of the bernoulli distribution.
dist_bernoulli_quantile_complement() Computes the complementary quantile function of the bernoulli distribution.
dist_bernoulli_range() Returns the range of the bernoulli distribution.
dist_bernoulli_sample() Generates random samples from the bernoulli distribution with specified parameters.
dist_bernoulli_skewness() Returns the skewness of the bernoulli distribution.
dist_bernoulli_stddev() Returns the standard deviation (σ) of the bernoulli distribution.
dist_bernoulli_support() Returns the support of the bernoulli distribution.
dist_bernoulli_variance() Returns the variance (σ²) of the bernoulli distribution.
Beta
dist_beta_cdf() Computes the cumulative distribution function (CDF) of the beta distribution.
dist_beta_cdf_complement() Computes the complementary cumulative distribution function (1 - CDF) of the beta distribution.
dist_beta_chf() Computes the cumulative hazard function of the beta distribution.
dist_beta_hazard() Computes the hazard function of the beta distribution.
dist_beta_kurtosis() Returns the kurtosis of the beta distribution.
dist_beta_kurtosis_excess() Returns the excess kurtosis of the beta distribution.
dist_beta_log_cdf() Computes the natural logarithm of the cumulative distribution function (CDF) of the beta distribution.
dist_beta_log_cdf_complement() Computes the natural logarithm of the complementary cumulative distribution function (1 - CDF) of the beta distribution.
dist_beta_log_pdf() Computes the natural logarithm of the probability density function (log-PDF) of the beta distribution.
dist_beta_mean() Returns the mean (μ) of the beta distribution, which is the first moment.
dist_beta_median() Returns the median (50th percentile) of the beta distribution, which equals the mean.
dist_beta_mode() Returns the mode (most likely value) of the beta distribution, which equals the mean.
dist_beta_pdf() Computes the probability density function (PDF) of the beta distribution.
dist_beta_quantile() Computes the quantile function (inverse CDF) of the beta distribution.
dist_beta_quantile_complement() Computes the complementary quantile function of the beta distribution.
dist_beta_range() Returns the range of the beta distribution.
dist_beta_sample() Generates random samples from the beta distribution with specified parameters.
dist_beta_skewness() Returns the skewness of the beta distribution.
dist_beta_stddev() Returns the standard deviation (σ) of the beta distribution.
dist_beta_support() Returns the support of the beta distribution.
dist_beta_variance() Returns the variance (σ²) of the beta distribution.
Binomial
dist_binomial_cdf() Computes the cumulative distribution function (CDF) of the binomial distribution.
dist_binomial_cdf_complement() Computes the complementary cumulative distribution function (1 - CDF) of the binomial distribution.
dist_binomial_chf() Computes the cumulative hazard function of the binomial distribution.
dist_binomial_hazard() Computes the hazard function of the binomial distribution.
dist_binomial_kurtosis() Returns the kurtosis of the binomial distribution.
dist_binomial_kurtosis_excess() Returns the excess kurtosis of the binomial distribution.
dist_binomial_log_cdf() Computes the natural logarithm of the cumulative distribution function (CDF) of the binomial distribution.
dist_binomial_log_cdf_complement() Computes the natural logarithm of the complementary cumulative distribution function (1 - CDF) of the binomial distribution.
dist_binomial_log_pdf() Computes the natural logarithm of the probability density function (log-PDF) of the binomial distribution.
dist_binomial_median() Returns the median (50th percentile) of the binomial distribution, which equals the mean.
dist_binomial_mode() Returns the mode (most likely value) of the binomial distribution, which equals the mean.
dist_binomial_pdf() Computes the probability density function (PDF) of the binomial distribution.
dist_binomial_quantile() Computes the quantile function (inverse CDF) of the binomial distribution.
dist_binomial_quantile_complement() Computes the complementary quantile function of the binomial distribution.
dist_binomial_range() Returns the range of the binomial distribution.
dist_binomial_sample() Generates random samples from the binomial distribution with specified parameters.
dist_binomial_skewness() Returns the skewness of the binomial distribution.
dist_binomial_support() Returns the support of the binomial distribution.
dist_binomial_variance() Returns the variance (σ²) of the binomial distribution.
Cauchy
dist_cauchy_cdf() Computes the cumulative distribution function (CDF) of the cauchy distribution.
dist_cauchy_cdf_complement() Computes the complementary cumulative distribution function (1 - CDF) of the cauchy distribution.
dist_cauchy_chf() Computes the cumulative hazard function of the cauchy distribution.
dist_cauchy_hazard() Computes the hazard function of the cauchy distribution.
dist_cauchy_log_cdf() Computes the natural logarithm of the cumulative distribution function (CDF) of the cauchy distribution.
dist_cauchy_log_cdf_complement() Computes the natural logarithm of the complementary cumulative distribution function (1 - CDF) of the cauchy distribution.
dist_cauchy_log_pdf() Computes the natural logarithm of the probability density function (log-PDF) of the cauchy distribution.
dist_cauchy_median() Returns the median (50th percentile) of the cauchy distribution, which equals the mean.
dist_cauchy_mode() Returns the mode (most likely value) of the cauchy distribution, which equals the mean.
dist_cauchy_pdf() Computes the probability density function (PDF) of the cauchy distribution.
dist_cauchy_quantile() Computes the quantile function (inverse CDF) of the cauchy distribution.
dist_cauchy_quantile_complement() Computes the complementary quantile function of the cauchy distribution.
dist_cauchy_range() Returns the range of the cauchy distribution.
dist_cauchy_sample() Generates random samples from the cauchy distribution with specified parameters.
dist_cauchy_support() Returns the support of the cauchy distribution.
Chi-squared
dist_chi_squared_cdf() Computes the cumulative distribution function (CDF) of the chi_squared distribution.
dist_chi_squared_cdf_complement() Computes the complementary cumulative distribution function (1 - CDF) of the chi_squared distribution.
dist_chi_squared_chf() Computes the cumulative hazard function of the chi_squared distribution.
dist_chi_squared_hazard() Computes the hazard function of the chi_squared distribution.
dist_chi_squared_kurtosis() Returns the kurtosis of the chi_squared distribution.
dist_chi_squared_kurtosis_excess() Returns the excess kurtosis of the chi_squared distribution.
dist_chi_squared_log_cdf() Computes the natural logarithm of the cumulative distribution function (CDF) of the chi_squared distribution.
dist_chi_squared_log_cdf_complement() Computes the natural logarithm of the complementary cumulative distribution function (1 - CDF) of the chi_squared distribution.
dist_chi_squared_log_pdf() Computes the natural logarithm of the probability density function (log-PDF) of the chi_squared distribution.
dist_chi_squared_mean() Returns the mean (μ) of the chi_squared distribution, which is the first moment.
dist_chi_squared_median() Returns the median (50th percentile) of the chi_squared distribution, which equals the mean.
dist_chi_squared_mode() Returns the mode (most likely value) of the chi_squared distribution, which equals the mean.
dist_chi_squared_pdf() Computes the probability density function (PDF) of the chi_squared distribution.
dist_chi_squared_quantile() Computes the quantile function (inverse CDF) of the chi_squared distribution.
dist_chi_squared_quantile_complement() Computes the complementary quantile function of the chi_squared distribution.
dist_chi_squared_range() Returns the range of the chi_squared distribution.
dist_chi_squared_sample() Generates random samples from the chi_squared distribution with specified parameters.
dist_chi_squared_skewness() Returns the skewness of the chi_squared distribution.
dist_chi_squared_stddev() Returns the standard deviation (σ) of the chi_squared distribution.
dist_chi_squared_support() Returns the support of the chi_squared distribution.
dist_chi_squared_variance() Returns the variance (σ²) of the chi_squared distribution.
Exponential
dist_exponential_cdf() Computes the cumulative distribution function (CDF) of the exponential distribution.
dist_exponential_cdf_complement() Computes the complementary cumulative distribution function (1 - CDF) of the exponential distribution.
dist_exponential_chf() Computes the cumulative hazard function of the exponential distribution.
dist_exponential_hazard() Computes the hazard function of the exponential distribution.
dist_exponential_kurtosis() Returns the kurtosis of the exponential distribution.
dist_exponential_kurtosis_excess() Returns the excess kurtosis of the exponential distribution.
dist_exponential_log_cdf() Computes the natural logarithm of the cumulative distribution function (CDF) of the exponential distribution.
dist_exponential_log_cdf_complement() Computes the natural logarithm of the complementary cumulative distribution function (1 - CDF) of the exponential distribution.
dist_exponential_log_pdf() Computes the natural logarithm of the probability density function (log-PDF) of the exponential distribution.
dist_exponential_mean() Returns the mean (μ) of the exponential distribution, which is the first moment.
dist_exponential_median() Returns the median (50th percentile) of the exponential distribution, which equals the mean.
dist_exponential_mode() Returns the mode (most likely value) of the exponential distribution, which equals the mean.
dist_exponential_pdf() Computes the probability density function (PDF) of the exponential distribution.
dist_exponential_quantile() Computes the quantile function (inverse CDF) of the exponential distribution.
dist_exponential_quantile_complement() Computes the complementary quantile function of the exponential distribution.
dist_exponential_range() Returns the range of the exponential distribution.
dist_exponential_sample() Generates random samples from the exponential distribution with specified parameters.
dist_exponential_skewness() Returns the skewness of the exponential distribution.
dist_exponential_stddev() Returns the standard deviation (σ) of the exponential distribution.
dist_exponential_support() Returns the support of the exponential distribution.
dist_exponential_variance() Returns the variance (σ²) of the exponential distribution.
Extreme Value
dist_extreme_value_cdf() Computes the cumulative distribution function (CDF) of the extreme_value distribution.
dist_extreme_value_cdf_complement() Computes the complementary cumulative distribution function (1 - CDF) of the extreme_value distribution.
dist_extreme_value_chf() Computes the cumulative hazard function of the extreme_value distribution.
dist_extreme_value_hazard() Computes the hazard function of the extreme_value distribution.
dist_extreme_value_kurtosis() Returns the kurtosis of the extreme_value distribution.
dist_extreme_value_kurtosis_excess() Returns the excess kurtosis of the extreme_value distribution.
dist_extreme_value_log_cdf() Computes the natural logarithm of the cumulative distribution function (CDF) of the extreme_value distribution.
dist_extreme_value_log_cdf_complement() Computes the natural logarithm of the complementary cumulative distribution function (1 - CDF) of the extreme_value distribution.
dist_extreme_value_log_pdf() Computes the natural logarithm of the probability density function (log-PDF) of the extreme_value distribution.
dist_extreme_value_median() Returns the median (50th percentile) of the extreme_value distribution, which equals the mean.
dist_extreme_value_mode() Returns the mode (most likely value) of the extreme_value distribution, which equals the mean.
dist_extreme_value_pdf() Computes the probability density function (PDF) of the extreme_value distribution.
dist_extreme_value_quantile() Computes the quantile function (inverse CDF) of the extreme_value distribution.
dist_extreme_value_quantile_complement() Computes the complementary quantile function of the extreme_value distribution.
dist_extreme_value_range() Returns the range of the extreme_value distribution.
dist_extreme_value_sample() Generates random samples from the extreme_value distribution with specified parameters.
dist_extreme_value_skewness() Returns the skewness of the extreme_value distribution.
dist_extreme_value_support() Returns the support of the extreme_value distribution.
dist_extreme_value_variance() Returns the variance (σ²) of the extreme_value distribution.
Fisher F
dist_fisher_f_cdf() Computes the cumulative distribution function (CDF) of the fisher_f distribution.
dist_fisher_f_cdf_complement() Computes the complementary cumulative distribution function (1 - CDF) of the fisher_f distribution.
dist_fisher_f_chf() Computes the cumulative hazard function of the fisher_f distribution.
dist_fisher_f_hazard() Computes the hazard function of the fisher_f distribution.
dist_fisher_f_kurtosis() Returns the kurtosis of the fisher_f distribution.
dist_fisher_f_kurtosis_excess() Returns the excess kurtosis of the fisher_f distribution.
dist_fisher_f_log_cdf() Computes the natural logarithm of the cumulative distribution function (CDF) of the fisher_f distribution.
dist_fisher_f_log_cdf_complement() Computes the natural logarithm of the complementary cumulative distribution function (1 - CDF) of the fisher_f distribution.
dist_fisher_f_log_pdf() Computes the natural logarithm of the probability density function (log-PDF) of the fisher_f distribution.
dist_fisher_f_median() Returns the median (50th percentile) of the fisher_f distribution, which equals the mean.
dist_fisher_f_mode() Returns the mode (most likely value) of the fisher_f distribution, which equals the mean.
dist_fisher_f_pdf() Computes the probability density function (PDF) of the fisher_f distribution.
dist_fisher_f_quantile() Computes the quantile function (inverse CDF) of the fisher_f distribution.
dist_fisher_f_quantile_complement() Computes the complementary quantile function of the fisher_f distribution.
dist_fisher_f_range() Returns the range of the fisher_f distribution.
dist_fisher_f_sample() Generates random samples from the fisher_f distribution with specified parameters.
dist_fisher_f_skewness() Returns the skewness of the fisher_f distribution.
dist_fisher_f_support() Returns the support of the fisher_f distribution.
dist_fisher_f_variance() Returns the variance (σ²) of the fisher_f distribution.
Gamma
dist_gamma_cdf() Computes the cumulative distribution function (CDF) of the gamma distribution.
dist_gamma_cdf_complement() Computes the complementary cumulative distribution function (1 - CDF) of the gamma distribution.
dist_gamma_chf() Computes the cumulative hazard function of the gamma distribution.
dist_gamma_hazard() Computes the hazard function of the gamma distribution.
dist_gamma_kurtosis() Returns the kurtosis of the gamma distribution.
dist_gamma_kurtosis_excess() Returns the excess kurtosis of the gamma distribution.
dist_gamma_log_cdf() Computes the natural logarithm of the cumulative distribution function (CDF) of the gamma distribution.
dist_gamma_log_cdf_complement() Computes the natural logarithm of the complementary cumulative distribution function (1 - CDF) of the gamma distribution.
dist_gamma_log_pdf() Computes the natural logarithm of the probability density function (log-PDF) of the gamma distribution.
dist_gamma_mean() Returns the mean (μ) of the gamma distribution, which is the first moment.
dist_gamma_median() Returns the median (50th percentile) of the gamma distribution, which equals the mean.
dist_gamma_mode() Returns the mode (most likely value) of the gamma distribution, which equals the mean.
dist_gamma_pdf() Computes the probability density function (PDF) of the gamma distribution.
dist_gamma_quantile() Computes the quantile function (inverse CDF) of the gamma distribution.
dist_gamma_quantile_complement() Computes the complementary quantile function of the gamma distribution.
dist_gamma_range() Returns the range of the gamma distribution.
dist_gamma_sample() Generates random samples from the gamma distribution with specified parameters.
dist_gamma_skewness() Returns the skewness of the gamma distribution.
dist_gamma_stddev() Returns the standard deviation (σ) of the gamma distribution.
dist_gamma_support() Returns the support of the gamma distribution.
dist_gamma_variance() Returns the variance (σ²) of the gamma distribution.
Geometric
dist_geometric_cdf() Computes the cumulative distribution function (CDF) of the geometric distribution.
dist_geometric_cdf_complement() Computes the complementary cumulative distribution function (1 - CDF) of the geometric distribution.
dist_geometric_chf() Computes the cumulative hazard function of the geometric distribution.
dist_geometric_hazard() Computes the hazard function of the geometric distribution.
dist_geometric_kurtosis() Returns the kurtosis of the geometric distribution.
dist_geometric_kurtosis_excess() Returns the excess kurtosis of the geometric distribution.
dist_geometric_log_cdf() Computes the natural logarithm of the cumulative distribution function (CDF) of the geometric distribution.
dist_geometric_log_cdf_complement() Computes the natural logarithm of the complementary cumulative distribution function (1 - CDF) of the geometric distribution.
dist_geometric_log_pdf() Computes the natural logarithm of the probability density function (log-PDF) of the geometric distribution.
dist_geometric_mean() Returns the mean (μ) of the geometric distribution, which is the first moment.
dist_geometric_median() Returns the median (50th percentile) of the geometric distribution, which equals the mean.
dist_geometric_mode() Returns the mode (most likely value) of the geometric distribution, which equals the mean.
dist_geometric_pdf() Computes the probability density function (PDF) of the geometric distribution.
dist_geometric_quantile() Computes the quantile function (inverse CDF) of the geometric distribution.
dist_geometric_quantile_complement() Computes the complementary quantile function of the geometric distribution.
dist_geometric_range() Returns the range of the geometric distribution.
dist_geometric_sample() Generates random samples from the geometric distribution with specified parameters.
dist_geometric_skewness() Returns the skewness of the geometric distribution.
dist_geometric_stddev() Returns the standard deviation (σ) of the geometric distribution.
dist_geometric_support() Returns the support of the geometric distribution.
dist_geometric_variance() Returns the variance (σ²) of the geometric distribution.
Laplace
dist_laplace_cdf() Computes the cumulative distribution function (CDF) of the laplace distribution.
dist_laplace_cdf_complement() Computes the complementary cumulative distribution function (1 - CDF) of the laplace distribution.
dist_laplace_chf() Computes the cumulative hazard function of the laplace distribution.
dist_laplace_hazard() Computes the hazard function of the laplace distribution.
dist_laplace_kurtosis() Returns the kurtosis of the laplace distribution.
dist_laplace_kurtosis_excess() Returns the excess kurtosis of the laplace distribution.
dist_laplace_log_cdf() Computes the natural logarithm of the cumulative distribution function (CDF) of the laplace distribution.
dist_laplace_log_cdf_complement() Computes the natural logarithm of the complementary cumulative distribution function (1 - CDF) of the laplace distribution.
dist_laplace_log_pdf() Computes the natural logarithm of the probability density function (log-PDF) of the laplace distribution.
dist_laplace_mean() Returns the mean (μ) of the laplace distribution, which is the first moment.
dist_laplace_median() Returns the median (50th percentile) of the laplace distribution, which equals the mean.
dist_laplace_mode() Returns the mode (most likely value) of the laplace distribution, which equals the mean.
dist_laplace_pdf() Computes the probability density function (PDF) of the laplace distribution.
dist_laplace_quantile() Computes the quantile function (inverse CDF) of the laplace distribution.
dist_laplace_quantile_complement() Computes the complementary quantile function of the laplace distribution.
dist_laplace_range() Returns the range of the laplace distribution.
dist_laplace_sample() Generates random samples from the laplace distribution with specified parameters.
dist_laplace_skewness() Returns the skewness of the laplace distribution.
dist_laplace_stddev() Returns the standard deviation (σ) of the laplace distribution.
dist_laplace_support() Returns the support of the laplace distribution.
dist_laplace_variance() Returns the variance (σ²) of the laplace distribution.
Log-normal
dist_lognormal_cdf() Computes the cumulative distribution function (CDF) of the lognormal distribution.
dist_lognormal_cdf_complement() Computes the complementary cumulative distribution function (1 - CDF) of the lognormal distribution.
dist_lognormal_chf() Computes the cumulative hazard function of the lognormal distribution.
dist_lognormal_hazard() Computes the hazard function of the lognormal distribution.
dist_lognormal_kurtosis() Returns the kurtosis of the lognormal distribution.
dist_lognormal_kurtosis_excess() Returns the excess kurtosis of the lognormal distribution.
dist_lognormal_log_cdf() Computes the natural logarithm of the cumulative distribution function (CDF) of the lognormal distribution.
dist_lognormal_log_cdf_complement() Computes the natural logarithm of the complementary cumulative distribution function (1 - CDF) of the lognormal distribution.
dist_lognormal_log_pdf() Computes the natural logarithm of the probability density function (log-PDF) of the lognormal distribution.
dist_lognormal_mean() Returns the mean (μ) of the lognormal distribution, which is the first moment.
dist_lognormal_median() Returns the median (50th percentile) of the lognormal distribution, which equals the mean.
dist_lognormal_mode() Returns the mode (most likely value) of the lognormal distribution, which equals the mean.
dist_lognormal_pdf() Computes the probability density function (PDF) of the lognormal distribution.
dist_lognormal_quantile() Computes the quantile function (inverse CDF) of the lognormal distribution.
dist_lognormal_quantile_complement() Computes the complementary quantile function of the lognormal distribution.
dist_lognormal_range() Returns the range of the lognormal distribution.
dist_lognormal_sample() Generates random samples from the lognormal distribution with specified parameters.
dist_lognormal_skewness() Returns the skewness of the lognormal distribution.
dist_lognormal_stddev() Returns the standard deviation (σ) of the lognormal distribution.
dist_lognormal_support() Returns the support of the lognormal distribution.
dist_lognormal_variance() Returns the variance (σ²) of the lognormal distribution.
Logistic
dist_logistic_cdf() Computes the cumulative distribution function (CDF) of the logistic distribution.
dist_logistic_cdf_complement() Computes the complementary cumulative distribution function (1 - CDF) of the logistic distribution.
dist_logistic_chf() Computes the cumulative hazard function of the logistic distribution.
dist_logistic_hazard() Computes the hazard function of the logistic distribution.
dist_logistic_kurtosis() Returns the kurtosis of the logistic distribution.
dist_logistic_kurtosis_excess() Returns the excess kurtosis of the logistic distribution.
dist_logistic_log_cdf() Computes the natural logarithm of the cumulative distribution function (CDF) of the logistic distribution.
dist_logistic_log_cdf_complement() Computes the natural logarithm of the complementary cumulative distribution function (1 - CDF) of the logistic distribution.
dist_logistic_log_pdf() Computes the natural logarithm of the probability density function (log-PDF) of the logistic distribution.
dist_logistic_median() Returns the median (50th percentile) of the logistic distribution, which equals the mean.
dist_logistic_mode() Returns the mode (most likely value) of the logistic distribution, which equals the mean.
dist_logistic_pdf() Computes the probability density function (PDF) of the logistic distribution.
dist_logistic_quantile() Computes the quantile function (inverse CDF) of the logistic distribution.
dist_logistic_quantile_complement() Computes the complementary quantile function of the logistic distribution.
dist_logistic_range() Returns the range of the logistic distribution.
dist_logistic_sample() Generates random samples from the logistic distribution with specified parameters.
dist_logistic_skewness() Returns the skewness of the logistic distribution.
dist_logistic_support() Returns the support of the logistic distribution.
dist_logistic_variance() Returns the variance (σ²) of the logistic distribution.
Negative Binomial
dist_negative_binomial_cdf() Computes the cumulative distribution function (CDF) of the negative_binomial distribution.
dist_negative_binomial_cdf_complement() Computes the complementary cumulative distribution function (1 - CDF) of the negative_binomial distribution.
dist_negative_binomial_chf() Computes the cumulative hazard function of the negative_binomial distribution.
dist_negative_binomial_hazard() Computes the hazard function of the negative_binomial distribution.
dist_negative_binomial_kurtosis() Returns the kurtosis of the negative_binomial distribution.
dist_negative_binomial_kurtosis_excess() Returns the excess kurtosis of the negative_binomial distribution.
dist_negative_binomial_log_cdf() Computes the natural logarithm of the cumulative distribution function (CDF) of the negative_binomial distribution.
dist_negative_binomial_log_cdf_complement() Computes the natural logarithm of the complementary cumulative distribution function (1 - CDF) of the negative_binomial distribution.
dist_negative_binomial_log_pdf() Computes the natural logarithm of the probability density function (log-PDF) of the negative_binomial distribution.
dist_negative_binomial_median() Returns the median (50th percentile) of the negative_binomial distribution, which equals the mean.
dist_negative_binomial_mode() Returns the mode (most likely value) of the negative_binomial distribution, which equals the mean.
dist_negative_binomial_pdf() Computes the probability density function (PDF) of the negative_binomial distribution.
dist_negative_binomial_quantile() Computes the quantile function (inverse CDF) of the negative_binomial distribution.
dist_negative_binomial_quantile_complement() Computes the complementary quantile function of the negative_binomial distribution.
dist_negative_binomial_range() Returns the range of the negative_binomial distribution.
dist_negative_binomial_sample() Generates random samples from the negative_binomial distribution with specified parameters.
dist_negative_binomial_skewness() Returns the skewness of the negative_binomial distribution.
dist_negative_binomial_support() Returns the support of the negative_binomial distribution.
dist_negative_binomial_variance() Returns the variance (σ²) of the negative_binomial distribution.
Normal
dist_normal_cdf() Computes the cumulative distribution function (CDF) of the normal distribution.
dist_normal_cdf_complement() Computes the complementary cumulative distribution function (1 - CDF) of the normal distribution.
dist_normal_chf() Computes the cumulative hazard function of the normal distribution.
dist_normal_hazard() Computes the hazard function of the normal distribution.
dist_normal_kurtosis() Returns the kurtosis of the normal distribution.
dist_normal_kurtosis_excess() Returns the excess kurtosis of the normal distribution.
dist_normal_log_cdf() Computes the natural logarithm of the cumulative distribution function (CDF) of the normal distribution.
dist_normal_log_cdf_complement() Computes the natural logarithm of the complementary cumulative distribution function (1 - CDF) of the normal distribution.
dist_normal_log_pdf() Computes the natural logarithm of the probability density function (log-PDF) of the normal distribution.
dist_normal_mean() Returns the mean (μ) of the normal distribution, which is the first moment.
dist_normal_median() Returns the median (50th percentile) of the normal distribution, which equals the mean.
dist_normal_mode() Returns the mode (most likely value) of the normal distribution, which equals the mean.
dist_normal_pdf() Computes the probability density function (PDF) of the normal distribution.
dist_normal_quantile() Computes the quantile function (inverse CDF) of the normal distribution.
dist_normal_quantile_complement() Computes the complementary quantile function of the normal distribution.
dist_normal_range() Returns the range of the normal distribution.
dist_normal_sample() Generates random samples from the normal distribution with specified parameters.
dist_normal_skewness() Returns the skewness of the normal distribution.
dist_normal_stddev() Returns the standard deviation (σ) of the normal distribution.
dist_normal_support() Returns the support of the normal distribution.
dist_normal_variance() Returns the variance (σ²) of the normal distribution.
Pareto
dist_pareto_cdf() Computes the cumulative distribution function (CDF) of the pareto distribution.
dist_pareto_cdf_complement() Computes the complementary cumulative distribution function (1 - CDF) of the pareto distribution.
dist_pareto_chf() Computes the cumulative hazard function of the pareto distribution.
dist_pareto_hazard() Computes the hazard function of the pareto distribution.
dist_pareto_kurtosis() Returns the kurtosis of the pareto distribution.
dist_pareto_kurtosis_excess() Returns the excess kurtosis of the pareto distribution.
dist_pareto_log_cdf() Computes the natural logarithm of the cumulative distribution function (CDF) of the pareto distribution.
dist_pareto_log_cdf_complement() Computes the natural logarithm of the complementary cumulative distribution function (1 - CDF) of the pareto distribution.
dist_pareto_log_pdf() Computes the natural logarithm of the probability density function (log-PDF) of the pareto distribution.
dist_pareto_mean() Returns the mean (μ) of the pareto distribution, which is the first moment.
dist_pareto_median() Returns the median (50th percentile) of the pareto distribution, which equals the mean.
dist_pareto_mode() Returns the mode (most likely value) of the pareto distribution, which equals the mean.
dist_pareto_pdf() Computes the probability density function (PDF) of the pareto distribution.
dist_pareto_quantile() Computes the quantile function (inverse CDF) of the pareto distribution.
dist_pareto_quantile_complement() Computes the complementary quantile function of the pareto distribution.
dist_pareto_range() Returns the range of the pareto distribution.
dist_pareto_sample() Generates random samples from the pareto distribution with specified parameters.
dist_pareto_skewness() Returns the skewness of the pareto distribution.
dist_pareto_stddev() Returns the standard deviation (σ) of the pareto distribution.
dist_pareto_support() Returns the support of the pareto distribution.
dist_pareto_variance() Returns the variance (σ²) of the pareto distribution.
Poisson
dist_poisson_cdf() Computes the cumulative distribution function (CDF) of the poisson distribution.
dist_poisson_cdf_complement() Computes the complementary cumulative distribution function (1 - CDF) of the poisson distribution.
dist_poisson_chf() Computes the cumulative hazard function of the poisson distribution.
dist_poisson_hazard() Computes the hazard function of the poisson distribution.
dist_poisson_kurtosis() Returns the kurtosis of the poisson distribution.
dist_poisson_kurtosis_excess() Returns the excess kurtosis of the poisson distribution.
dist_poisson_log_cdf() Computes the natural logarithm of the cumulative distribution function (CDF) of the poisson distribution.
dist_poisson_log_cdf_complement() Computes the natural logarithm of the complementary cumulative distribution function (1 - CDF) of the poisson distribution.
dist_poisson_log_pdf() Computes the natural logarithm of the probability density function (log-PDF) of the poisson distribution.
dist_poisson_mean() Returns the mean (μ) of the poisson distribution, which is the first moment.
dist_poisson_median() Returns the median (50th percentile) of the poisson distribution, which equals the mean.
dist_poisson_mode() Returns the mode (most likely value) of the poisson distribution, which equals the mean.
dist_poisson_pdf() Computes the probability density function (PDF) of the poisson distribution.
dist_poisson_quantile() Computes the quantile function (inverse CDF) of the poisson distribution.
dist_poisson_quantile_complement() Computes the complementary quantile function of the poisson distribution.
dist_poisson_range() Returns the range of the poisson distribution.
dist_poisson_sample() Generates random samples from the poisson distribution with specified parameters.
dist_poisson_skewness() Returns the skewness of the poisson distribution.
dist_poisson_stddev() Returns the standard deviation (σ) of the poisson distribution.
dist_poisson_support() Returns the support of the poisson distribution.
dist_poisson_variance() Returns the variance (σ²) of the poisson distribution.
Rayleigh
dist_rayleigh_cdf() Computes the cumulative distribution function (CDF) of the rayleigh distribution.
dist_rayleigh_cdf_complement() Computes the complementary cumulative distribution function (1 - CDF) of the rayleigh distribution.
dist_rayleigh_chf() Computes the cumulative hazard function of the rayleigh distribution.
dist_rayleigh_hazard() Computes the hazard function of the rayleigh distribution.
dist_rayleigh_kurtosis() Returns the kurtosis of the rayleigh distribution.
dist_rayleigh_kurtosis_excess() Returns the excess kurtosis of the rayleigh distribution.
dist_rayleigh_log_cdf() Computes the natural logarithm of the cumulative distribution function (CDF) of the rayleigh distribution.
dist_rayleigh_log_cdf_complement() Computes the natural logarithm of the complementary cumulative distribution function (1 - CDF) of the rayleigh distribution.
dist_rayleigh_log_pdf() Computes the natural logarithm of the probability density function (log-PDF) of the rayleigh distribution.
dist_rayleigh_mean() Returns the mean (μ) of the rayleigh distribution, which is the first moment.
dist_rayleigh_median() Returns the median (50th percentile) of the rayleigh distribution, which equals the mean.
dist_rayleigh_mode() Returns the mode (most likely value) of the rayleigh distribution, which equals the mean.
dist_rayleigh_pdf() Computes the probability density function (PDF) of the rayleigh distribution.
dist_rayleigh_quantile() Computes the quantile function (inverse CDF) of the rayleigh distribution.
dist_rayleigh_quantile_complement() Computes the complementary quantile function of the rayleigh distribution.
dist_rayleigh_range() Returns the range of the rayleigh distribution.
dist_rayleigh_sample() Generates random samples from the rayleigh distribution with specified parameters.
dist_rayleigh_skewness() Returns the skewness of the rayleigh distribution.
dist_rayleigh_stddev() Returns the standard deviation (σ) of the rayleigh distribution.
dist_rayleigh_support() Returns the support of the rayleigh distribution.
dist_rayleigh_variance() Returns the variance (σ²) of the rayleigh distribution.
Student's t
dist_students_t_cdf() Computes the cumulative distribution function (CDF) of the students_t distribution.
dist_students_t_cdf_complement() Computes the complementary cumulative distribution function (1 - CDF) of the students_t distribution.
dist_students_t_chf() Computes the cumulative hazard function of the students_t distribution.
dist_students_t_hazard() Computes the hazard function of the students_t distribution.
dist_students_t_kurtosis() Returns the kurtosis of the students_t distribution.
dist_students_t_kurtosis_excess() Returns the excess kurtosis of the students_t distribution.
dist_students_t_log_cdf() Computes the natural logarithm of the cumulative distribution function (CDF) of the students_t distribution.
dist_students_t_log_cdf_complement() Computes the natural logarithm of the complementary cumulative distribution function (1 - CDF) of the students_t distribution.
dist_students_t_log_pdf() Computes the natural logarithm of the probability density function (log-PDF) of the students_t distribution.
dist_students_t_mean() Returns the mean (μ) of the students_t distribution, which is the first moment.
dist_students_t_median() Returns the median (50th percentile) of the students_t distribution, which equals the mean.
dist_students_t_mode() Returns the mode (most likely value) of the students_t distribution, which equals the mean.
dist_students_t_pdf() Computes the probability density function (PDF) of the students_t distribution.
dist_students_t_quantile() Computes the quantile function (inverse CDF) of the students_t distribution.
dist_students_t_quantile_complement() Computes the complementary quantile function of the students_t distribution.
dist_students_t_range() Returns the range of the students_t distribution.
dist_students_t_sample() Generates random samples from the students_t distribution with specified parameters.
dist_students_t_skewness() Returns the skewness of the students_t distribution.
dist_students_t_stddev() Returns the standard deviation (σ) of the students_t distribution.
dist_students_t_support() Returns the support of the students_t distribution.
dist_students_t_variance() Returns the variance (σ²) of the students_t distribution.
Uniform (Integer)
dist_uniform_int_cdf() Computes the cumulative distribution function (CDF) of the uniform_int distribution.
dist_uniform_int_cdf_complement() Computes the complementary cumulative distribution function (1 - CDF) of the uniform_int distribution.
dist_uniform_int_chf() Computes the cumulative hazard function of the uniform_int distribution.
dist_uniform_int_hazard() Computes the hazard function of the uniform_int distribution.
dist_uniform_int_kurtosis() Returns the kurtosis of the uniform_int distribution.
dist_uniform_int_kurtosis_excess() Returns the excess kurtosis of the uniform_int distribution.
dist_uniform_int_log_cdf() Computes the natural logarithm of the cumulative distribution function (CDF) of the uniform_int distribution.
dist_uniform_int_log_cdf_complement() Computes the natural logarithm of the complementary cumulative distribution function (1 - CDF) of the uniform_int distribution.
dist_uniform_int_log_pdf() Computes the natural logarithm of the probability density function (log-PDF) of the uniform_int distribution.
dist_uniform_int_mean() Returns the mean (μ) of the uniform_int distribution, which is the first moment.
dist_uniform_int_median() Returns the median (50th percentile) of the uniform_int distribution, which equals the mean.
dist_uniform_int_mode() Returns the mode (most likely value) of the uniform_int distribution, which equals the mean.
dist_uniform_int_pdf() Computes the probability density function (PDF) of the uniform_int distribution.
dist_uniform_int_quantile() Computes the quantile function (inverse CDF) of the uniform_int distribution.
dist_uniform_int_quantile_complement() Computes the complementary quantile function of the uniform_int distribution.
dist_uniform_int_range() Returns the range of the uniform_int distribution.
dist_uniform_int_sample() Generates random samples from the uniform_int distribution with specified parameters.
dist_uniform_int_skewness() Returns the skewness of the uniform_int distribution.
dist_uniform_int_stddev() Returns the standard deviation (σ) of the uniform_int distribution.
dist_uniform_int_support() Returns the support of the uniform_int distribution.
dist_uniform_int_variance() Returns the variance (σ²) of the uniform_int distribution.
Uniform (Real)
dist_uniform_real_cdf() Computes the cumulative distribution function (CDF) of the uniform_real distribution.
dist_uniform_real_cdf_complement() Computes the complementary cumulative distribution function (1 - CDF) of the uniform_real distribution.
dist_uniform_real_chf() Computes the cumulative hazard function of the uniform_real distribution.
dist_uniform_real_hazard() Computes the hazard function of the uniform_real distribution.
dist_uniform_real_kurtosis() Returns the kurtosis of the uniform_real distribution.
dist_uniform_real_kurtosis_excess() Returns the excess kurtosis of the uniform_real distribution.
dist_uniform_real_log_cdf() Computes the natural logarithm of the cumulative distribution function (CDF) of the uniform_real distribution.
dist_uniform_real_log_cdf_complement() Computes the natural logarithm of the complementary cumulative distribution function (1 - CDF) of the uniform_real distribution.
dist_uniform_real_log_pdf() Computes the natural logarithm of the probability density function (log-PDF) of the uniform_real distribution.
dist_uniform_real_mean() Returns the mean (μ) of the uniform_real distribution, which is the first moment.
dist_uniform_real_median() Returns the median (50th percentile) of the uniform_real distribution, which equals the mean.
dist_uniform_real_mode() Returns the mode (most likely value) of the uniform_real distribution, which equals the mean.
dist_uniform_real_pdf() Computes the probability density function (PDF) of the uniform_real distribution.
dist_uniform_real_quantile() Computes the quantile function (inverse CDF) of the uniform_real distribution.
dist_uniform_real_quantile_complement() Computes the complementary quantile function of the uniform_real distribution.
dist_uniform_real_range() Returns the range of the uniform_real distribution.
dist_uniform_real_sample() Generates random samples from the uniform_real distribution with specified parameters.
dist_uniform_real_skewness() Returns the skewness of the uniform_real distribution.
dist_uniform_real_stddev() Returns the standard deviation (σ) of the uniform_real distribution.
dist_uniform_real_support() Returns the support of the uniform_real distribution.
dist_uniform_real_variance() Returns the variance (σ²) of the uniform_real distribution.
Weibull
dist_weibull_cdf() Computes the cumulative distribution function (CDF) of the weibull distribution.
dist_weibull_cdf_complement() Computes the complementary cumulative distribution function (1 - CDF) of the weibull distribution.
dist_weibull_chf() Computes the cumulative hazard function of the weibull distribution.
dist_weibull_hazard() Computes the hazard function of the weibull distribution.
dist_weibull_kurtosis() Returns the kurtosis of the weibull distribution.
dist_weibull_kurtosis_excess() Returns the excess kurtosis of the weibull distribution.
dist_weibull_log_cdf() Computes the natural logarithm of the cumulative distribution function (CDF) of the weibull distribution.
dist_weibull_log_cdf_complement() Computes the natural logarithm of the complementary cumulative distribution function (1 - CDF) of the weibull distribution.
dist_weibull_log_pdf() Computes the natural logarithm of the probability density function (log-PDF) of the weibull distribution.
dist_weibull_median() Returns the median (50th percentile) of the weibull distribution, which equals the mean.
dist_weibull_mode() Returns the mode (most likely value) of the weibull distribution, which equals the mean.
dist_weibull_pdf() Computes the probability density function (PDF) of the weibull distribution.
dist_weibull_quantile() Computes the quantile function (inverse CDF) of the weibull distribution.
dist_weibull_quantile_complement() Computes the complementary quantile function of the weibull distribution.
dist_weibull_range() Returns the range of the weibull distribution.
dist_weibull_sample() Generates random samples from the weibull distribution with specified parameters.
dist_weibull_skewness() Returns the skewness of the weibull distribution.
dist_weibull_support() Returns the support of the weibull distribution.
dist_weibull_variance() Returns the variance (σ²) of the weibull distribution.

API Reference

Function Documentation

Practical Examples

Cookbook

Real-world recipes and patterns for common use cases.

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

Release status Stable
Software License MIT
Pricing Free
Written In C++
Source Available Yes
View on GitHub
Usage
641,105
loads · last 90 days

Platforms

  • Linux x86_64 aarch64
  • Linux (musl) Not available
  • macOS Intel Apple Silicon
  • Windows x86_64
  • WASM eh mvp threads
Compiled binary sizes
Platform Architecture Size
Linux x86_64 4.56 MB
Linux aarch64 4.03 MB
macOS Intel 3.03 MB
macOS Apple Silicon 2.65 MB
Windows x86_64 8.38 MB
WASM eh 637.4 KB
WASM mvp 578.9 KB
WASM threads 637.7 KB

Compressed download size from the Haybarn extension repository.

DuckDB & Haybarn

Release calendar