Search Shortcut cmd + k | ctrl + k
duckfn_statrs

Statistical functions from the Rust statrs crate - 34 aggregates and 509 scalars covering every statrs module

Maintainer(s): shijianjs

Installing and Loading

INSTALL duckfn_statrs FROM community;
LOAD duckfn_statrs;

Example

-- Summary statistics are aggregates over a DOUBLE column
SELECT sr_mean(x) FROM (VALUES (1.0), (2.0), (3.0)) t(x);
-- 2.0

SELECT g, sr_median(x) FROM (VALUES (1, 3.0), (1, 1.0), (1, NULL), (2, 10.0)) t(g, x) GROUP BY g ORDER BY g;
-- 1  |  2.0
-- 2  |  10.0

-- Distribution functions are scalars, evaluated row by row
SELECT sr_normal_quantile(0.975, 0.0, 1.0);
-- 1.9599639845400538

About duckfn_statrs

Wraps the Rust statrs crate as DuckDB functions - currently 34 aggregates and 509 scalars, covering every statrs module: statistics (means, order statistics incl. percentile / ranks, variance families, covariance of two row-paired columns), distribution (20 continuous and 8 discrete univariate incl. Categorical, 4 multivariate over LIST vectors and row-major flattened matrices, Empirical as aggregates, plus rand-integration sampling for all of them incl. statrs' BinomialAlgorithm sampler), density (kde_pdf / knn_pdf via the kde feature), function (erf / gamma / beta families, factorials, harmonic numbers, logistic / logit, nine kernels selected by name, polynomial evaluation), generate (waveform and log-spaced sequences) and stats_tests (t-test, skewtest, Anderson-Darling, two-sample KS, Mann-Whitney U, chi-square, one-way ANOVA, Fisher's exact - returning [statistic, p-value]). Integer slots (binomial n, pmf x, sample k) are UBIGINT/BIGINT arguments - a non-integer literal does not bind.

Constants follow statrs: the mathematical ones plus its own floating-point precision thresholds with sr_almost_eq, so a query can reuse statrs' notion of "close enough" instead of hard-coding an epsilon.

NULL semantics follow statrs and propagate to the SQL side: a NULL row never enters an aggregate; whatever statrs cannot define (empty group, sample variance of one value, an out-of-range tau, negatives in the geometric / harmonic means) comes back as NULL, never as a NAN value. A parameter that is present but invalid (std_dev <= 0, a probability outside [0, 1], a non-integer where statrs wants one) fails the query.

Requires DuckDB 1.3 or newer: the extension is built against DuckDB 1.5.6 headers but declares the C API floor it needs (v1.2.0), so one binary loads into 1.3.2 through 1.5.6 alike. Development notes and the full function table live in the repository: https://github.com/shijianjs/duckfn-statrs.

Added Functions

function_name function_type description comment examples
sr_2_sqrt_e_over_pi scalar The constant 2*sqrt(e/PI) NULL [SELECT sr_2_sqrt_e_over_pi()]
sr_abs_max aggregate Largest absolute value in a DOUBLE column (statrs' Statistics::abs_max), NULL when no row is non-NULL NULL [SELECT sr_abs_max(x) FROM (VALUES (0.0), (3.0), (-8.0)) t(x)]
sr_abs_min aggregate Smallest absolute value in a DOUBLE column (statrs' Statistics::abs_min), NULL when no row is non-NULL NULL [SELECT sr_abs_min(x) FROM (VALUES (3.0), (-2.0)) t(x)]
sr_almost_eq scalar Whether two DOUBLEs are within the absolute tolerance acc of each other (statrs' almost_eq); infinities only match themselves and NaN never matches NULL [SELECT sr_almost_eq(0.1 + 0.2, 0.3, 1e-9)]
sr_anderson_darling scalar Anderson-Darling goodness-of-fit test of a LIST(DOUBLE) sample against a named distribution (normal / lognormal / exponential / gumbel / weibull / uniform) with its parameter LIST: LIST [A-squared, 5% critical value] NULL [SELECT sr_anderson_darling([1.0, 2.0, 3.0, 4.0], 'normal', [2.5, 1.0])]
sr_bernoulli_cdf scalar Bernoulli cumulative distribution function P(X <= x) NULL [SELECT sr_bernoulli_cdf(1, 0.7)]
sr_bernoulli_entropy scalar Bernoulli entropy NULL [SELECT sr_bernoulli_entropy(0.7)]
sr_bernoulli_ln_pmf scalar Bernoulli log probability mass at x NULL [SELECT sr_bernoulli_ln_pmf(1, 0.7)]
sr_bernoulli_max scalar Bernoulli maximum of the support (1) NULL [SELECT sr_bernoulli_max(0.7)]
sr_bernoulli_mean scalar Bernoulli mean NULL [SELECT sr_bernoulli_mean(0.7)]
sr_bernoulli_median scalar Bernoulli median NULL [SELECT sr_bernoulli_median(0.7)]
sr_bernoulli_min scalar Bernoulli minimum of the support (0) NULL [SELECT sr_bernoulli_min(0.7)]
sr_bernoulli_mode scalar Bernoulli mode NULL [SELECT sr_bernoulli_mode(0.7)]
sr_bernoulli_pmf scalar Bernoulli probability mass P(X = x) for x in {0, 1}, given success probability p NULL [SELECT sr_bernoulli_pmf(1, 0.7)]
sr_bernoulli_quantile scalar Bernoulli quantile function: the x whose CDF equals p, for p in [0, 1] NULL [SELECT sr_bernoulli_quantile(0.5, 0.7)]
sr_bernoulli_sf scalar Bernoulli survival function P(X > x) NULL [SELECT sr_bernoulli_sf(0, 0.7)]
sr_bernoulli_skewness scalar Bernoulli skewness NULL [SELECT sr_bernoulli_skewness(0.7)]
sr_bernoulli_std_dev scalar Bernoulli standard deviation NULL [SELECT sr_bernoulli_std_dev(0.7)]
sr_bernoulli_variance scalar Bernoulli variance NULL [SELECT sr_bernoulli_variance(0.7)]
sr_beta scalar Beta function B(a, b) NULL [SELECT sr_beta(2.0, 3.0)]
sr_beta_cdf scalar Beta cumulative distribution function P(X <= x) NULL [SELECT sr_beta_cdf(0.5, 2.0, 3.0)]
sr_beta_entropy scalar Beta differential entropy, given shape_a and shape_b NULL [SELECT sr_beta_entropy(2.0, 3.0)]
sr_beta_incomplete scalar Incomplete Beta function B(x; a, b), integrating from 0 to x NULL [SELECT sr_beta_incomplete(2.0, 3.0, 0.5)]
sr_beta_ln_pdf scalar Beta log-density at x NULL [SELECT sr_beta_ln_pdf(0.5, 2.0, 3.0)]
sr_beta_max scalar Beta maximum of the support (1) NULL [SELECT sr_beta_max(2.0, 3.0)]
sr_beta_mean scalar Beta mean, given shape_a and shape_b NULL [SELECT sr_beta_mean(2.0, 3.0)]
sr_beta_min scalar Beta minimum of the support (0) NULL [SELECT sr_beta_min(2.0, 3.0)]
sr_beta_mode scalar Beta mode, given shape_a and shape_b NULL [SELECT sr_beta_mode(2.0, 3.0)]
sr_beta_pdf scalar Beta probability density at x, given shape_a and shape_b NULL [SELECT sr_beta_pdf(0.5, 2.0, 3.0)]
sr_beta_quantile scalar Beta quantile function: the x whose CDF equals p, for p in [0, 1] NULL [SELECT sr_beta_quantile(0.5, 2.0, 3.0)]
sr_beta_regularized scalar Regularized incomplete Beta function I(x; a, b) NULL [SELECT sr_beta_regularized(2.0, 3.0, 0.5)]
sr_beta_sf scalar Beta survival function P(X > x) NULL [SELECT sr_beta_sf(0.5, 2.0, 3.0)]
sr_beta_skewness scalar Beta skewness, given shape_a and shape_b NULL [SELECT sr_beta_skewness(2.0, 3.0)]
sr_beta_std_dev scalar Beta standard deviation, given shape_a and shape_b NULL [SELECT sr_beta_std_dev(2.0, 3.0)]
sr_beta_variance scalar Beta variance, given shape_a and shape_b NULL [SELECT sr_beta_variance(2.0, 3.0)]
sr_binomial_cdf scalar Binomial cumulative distribution function P(X <= x) NULL [SELECT sr_binomial_cdf(3, 0.5, 10)]
sr_binomial_entropy scalar Binomial entropy NULL [SELECT sr_binomial_entropy(0.5, 10)]
sr_binomial_ln_pmf scalar Binomial log probability mass at x NULL [SELECT sr_binomial_ln_pmf(3, 0.5, 10)]
sr_binomial_max scalar Binomial maximum of the support (n) NULL [SELECT sr_binomial_max(0.5, 10)]
sr_binomial_mean scalar Binomial mean NULL [SELECT sr_binomial_mean(0.5, 10)]
sr_binomial_median scalar Binomial median NULL [SELECT sr_binomial_median(0.5, 10)]
sr_binomial_min scalar Binomial minimum of the support (0) NULL [SELECT sr_binomial_min(0.5, 10)]
sr_binomial_mode scalar Binomial mode NULL [SELECT sr_binomial_mode(0.5, 10)]
sr_binomial_pmf scalar Binomial probability mass P(X = x), given success probability p and number of trials n NULL [SELECT sr_binomial_pmf(3, 0.5, 10)]
sr_binomial_quantile scalar Binomial quantile function: the x whose CDF equals p, for p in [0, 1] NULL [SELECT sr_binomial_quantile(0.5, 0.5, 10)]
sr_binomial_sf scalar Binomial survival function P(X > x) NULL [SELECT sr_binomial_sf(3, 0.5, 10)]
sr_binomial_skewness scalar Binomial skewness NULL [SELECT sr_binomial_skewness(0.5, 10)]
sr_binomial_std_dev scalar Binomial standard deviation NULL [SELECT sr_binomial_std_dev(0.5, 10)]
sr_binomial_variance scalar Binomial variance NULL [SELECT sr_binomial_variance(0.5, 10)]
sr_categorical_cdf scalar Categorical cumulative distribution function P(X <= x) NULL [SELECT sr_categorical_cdf(1, [1.0, 2.0, 1.0])]
sr_categorical_entropy scalar Categorical entropy NULL [SELECT sr_categorical_entropy([1.0, 2.0, 1.0])]
sr_categorical_ln_pmf scalar Categorical log probability mass at x NULL [SELECT sr_categorical_ln_pmf(1, [1.0, 2.0, 1.0])]
sr_categorical_max scalar Categorical maximum of the support (last category index) NULL [SELECT sr_categorical_max([1.0, 2.0, 1.0])]
sr_categorical_mean scalar Categorical mean NULL [SELECT sr_categorical_mean([1.0, 2.0, 1.0])]
sr_categorical_median scalar Categorical median NULL [SELECT sr_categorical_median([1.0, 2.0, 1.0])]
sr_categorical_min scalar Categorical minimum of the support (category index 0) NULL [SELECT sr_categorical_min([1.0, 2.0, 1.0])]
sr_categorical_pmf scalar Categorical probability mass P(X = x) for a distribution given by an unnormalised probability LIST (normalised by statrs) NULL [SELECT sr_categorical_pmf(1, [1.0, 2.0, 1.0])]
sr_categorical_quantile scalar Categorical quantile function: the x whose CDF equals p, for p in [0, 1] NULL [SELECT sr_categorical_quantile(0.5, [1.0, 2.0, 1.0])]
sr_categorical_sf scalar Categorical survival function P(X > x) NULL [SELECT sr_categorical_sf(1, [1.0, 2.0, 1.0])]
sr_categorical_skewness scalar Categorical skewness NULL [SELECT sr_categorical_skewness([1.0, 2.0, 1.0])]
sr_categorical_std_dev scalar Categorical standard deviation NULL [SELECT sr_categorical_std_dev([1.0, 2.0, 1.0])]
sr_categorical_variance scalar Categorical variance NULL [SELECT sr_categorical_variance([1.0, 2.0, 1.0])]
sr_cauchy_cdf scalar Cauchy cumulative distribution function P(X <= x) NULL [SELECT sr_cauchy_cdf(1.0, 0.0, 1.0)]
sr_cauchy_entropy scalar Cauchy distribution differential entropy NULL [SELECT sr_cauchy_entropy(0.0, 1.0)]
sr_cauchy_ln_pdf scalar Cauchy log-density at x NULL [SELECT sr_cauchy_ln_pdf(1.0, 0.0, 1.0)]
sr_cauchy_max scalar Cauchy distribution support maximum (positive infinity) NULL [SELECT sr_cauchy_max(0.0, 1.0)]
sr_cauchy_mean scalar Cauchy distribution mean (undefined) NULL [SELECT sr_cauchy_mean(0.0, 1.0)]
sr_cauchy_median scalar Cauchy distribution median NULL [SELECT sr_cauchy_median(0.0, 1.0)]
sr_cauchy_min scalar Cauchy distribution support minimum (negative infinity) NULL [SELECT sr_cauchy_min(0.0, 1.0)]
sr_cauchy_mode scalar Cauchy distribution mode NULL [SELECT sr_cauchy_mode(0.0, 1.0)]
sr_cauchy_pdf scalar Cauchy probability density at x, given location and scale NULL [SELECT sr_cauchy_pdf(1.0, 0.0, 1.0)]
sr_cauchy_quantile scalar Cauchy quantile function: the x whose CDF equals p, for p in [0, 1] NULL [SELECT sr_cauchy_quantile(0.5, 0.0, 1.0)]
sr_cauchy_sf scalar Cauchy survival function P(X > x) NULL [SELECT sr_cauchy_sf(1.0, 0.0, 1.0)]
sr_cauchy_skewness scalar Cauchy distribution skewness (undefined) NULL [SELECT sr_cauchy_skewness(0.0, 1.0)]
sr_cauchy_std_dev scalar Cauchy distribution standard deviation (undefined) NULL [SELECT sr_cauchy_std_dev(0.0, 1.0)]
sr_cauchy_variance scalar Cauchy distribution variance (undefined) NULL [SELECT sr_cauchy_variance(0.0, 1.0)]
sr_chi_cdf scalar Chi distribution cumulative distribution function P(X <= x) NULL [SELECT sr_chi_cdf(1.0, 2)]
sr_chi_entropy scalar Chi distribution differential entropy, given UBIGINT freedom NULL [SELECT sr_chi_entropy(2)]
sr_chi_ln_pdf scalar Chi distribution log-density at x NULL [SELECT sr_chi_ln_pdf(1.0, 2)]
sr_chi_max scalar Chi distribution maximum of the support (positive infinity) NULL [SELECT sr_chi_max(2)]
sr_chi_mean scalar Chi distribution mean, given UBIGINT freedom NULL [SELECT sr_chi_mean(2)]
sr_chi_min scalar Chi distribution minimum of the support (0) NULL [SELECT sr_chi_min(2)]
sr_chi_mode scalar Chi distribution mode, given UBIGINT freedom NULL [SELECT sr_chi_mode(2)]
sr_chi_pdf scalar Chi distribution probability density at x (the sqrt-chi-squared distribution), UBIGINT freedom NULL [SELECT sr_chi_pdf(1.0, 2)]
sr_chi_quantile scalar Chi distribution quantile function: the x whose CDF equals p, for p in [0, 1] NULL [SELECT sr_chi_quantile(0.5, 2)]
sr_chi_sf scalar Chi distribution survival function P(X > x) NULL [SELECT sr_chi_sf(1.0, 2)]
sr_chi_skewness scalar Chi distribution skewness, given UBIGINT freedom NULL [SELECT sr_chi_skewness(2)]
sr_chi_squared_cdf scalar Chi-squared cumulative distribution function P(X <= x) NULL [SELECT sr_chi_squared_cdf(1.0, 2.0)]
sr_chi_squared_entropy scalar Chi-squared differential entropy, given degrees of freedom NULL [SELECT sr_chi_squared_entropy(2.0)]
sr_chi_squared_ln_pdf scalar Chi-squared log-density at x NULL [SELECT sr_chi_squared_ln_pdf(1.0, 2.0)]
sr_chi_squared_max scalar Chi-squared maximum of the support (positive infinity) NULL [SELECT sr_chi_squared_max(2.0)]
sr_chi_squared_mean scalar Chi-squared mean, given degrees of freedom NULL [SELECT sr_chi_squared_mean(2.0)]
sr_chi_squared_median scalar Chi-squared median, given degrees of freedom NULL [SELECT sr_chi_squared_median(2.0)]
sr_chi_squared_min scalar Chi-squared minimum of the support (0) NULL [SELECT sr_chi_squared_min(2.0)]
sr_chi_squared_mode scalar Chi-squared mode, given degrees of freedom NULL [SELECT sr_chi_squared_mode(2.0)]
sr_chi_squared_pdf scalar Chi-squared probability density at x, given degrees of freedom NULL [SELECT sr_chi_squared_pdf(1.0, 2.0)]
sr_chi_squared_quantile scalar Chi-squared quantile function: the x whose CDF equals p, for p in [0, 1] NULL [SELECT sr_chi_squared_quantile(0.95, 2.0)]
sr_chi_squared_sf scalar Chi-squared survival function P(X > x) NULL [SELECT sr_chi_squared_sf(1.0, 2.0)]
sr_chi_squared_skewness scalar Chi-squared skewness, given degrees of freedom NULL [SELECT sr_chi_squared_skewness(2.0)]
sr_chi_squared_std_dev scalar Chi-squared standard deviation, given degrees of freedom NULL [SELECT sr_chi_squared_std_dev(2.0)]
sr_chi_squared_variance scalar Chi-squared variance, given degrees of freedom NULL [SELECT sr_chi_squared_variance(2.0)]
sr_chi_std_dev scalar Chi distribution standard deviation, given UBIGINT freedom NULL [SELECT sr_chi_std_dev(2)]
sr_chi_variance scalar Chi distribution variance, given UBIGINT freedom NULL [SELECT sr_chi_variance(2)]
sr_chisquare scalar Chi-square goodness-of-fit test on an observed-count LIST(UBIGINT) (expected frequencies optional, defaults to uniform; ddof optional UBIGINT): LIST [chi-square statistic, p-value] NULL [SELECT sr_chisquare([16, 18, 16, 14, 12, 12], NULL, NULL)]
sr_choose scalar Binomial coefficient C(n, k) (statrs' factorial::binomial), n and k UBIGINTs NULL [SELECT sr_choose(10, 3)]
sr_covariance aggregate Sample covariance of two DOUBLE columns (Bessel-corrected), NULL when fewer than two rows are fully non-NULL A row with a NULL in either column is skipped entirely, keeping the two columns paired [SELECT sr_covariance(x, y) FROM (VALUES (0.0, -5.0), (3.0, 4.0), (-2.0, 10.0)) t(x, y)]
sr_default_eps scalar statrs' default target absolute accuracy for f64 operations, 1e-9 NULL [SELECT sr_default_eps()]
sr_default_f64_acc scalar statrs' default absolute comparison tolerance for f64 (0.01 * F64_PREC) NULL [SELECT sr_default_f64_acc()]
sr_default_relative_acc scalar statrs' default target relative accuracy for f64 operations, 1e-14 NULL [SELECT sr_default_relative_acc()]
sr_default_ulps scalar statrs' default target ULPs accuracy for f64 operations (5), as a UINTEGER NULL [SELECT sr_default_ulps()]
sr_digamma scalar Digamma function ψ(x), the derivative of ln(Γ(x)) NULL [SELECT sr_digamma(2.0)]
sr_dirac_cdf scalar Dirac delta cumulative distribution function P(X <= x) NULL [SELECT sr_dirac_cdf(1.0, 1.0)]
sr_dirac_entropy scalar Dirac delta distribution differential entropy NULL [SELECT sr_dirac_entropy(1.0)]
sr_dirac_max scalar Dirac delta distribution support maximum (v) NULL [SELECT sr_dirac_max(1.0)]
sr_dirac_mean scalar Dirac delta distribution mean (always v) NULL [SELECT sr_dirac_mean(1.0)]
sr_dirac_median scalar Dirac delta distribution median (always v) NULL [SELECT sr_dirac_median(1.0)]
sr_dirac_min scalar Dirac delta distribution support minimum (v) NULL [SELECT sr_dirac_min(1.0)]
sr_dirac_mode scalar Dirac delta distribution mode (always v) NULL [SELECT sr_dirac_mode(1.0)]
sr_dirac_quantile scalar Dirac delta quantile function: always the location v NULL [SELECT sr_dirac_quantile(0.5, 1.0)]
sr_dirac_sf scalar Dirac delta survival function P(X > x) NULL [SELECT sr_dirac_sf(0.5, 1.0)]
sr_dirac_skewness scalar Dirac delta distribution skewness (always 0) NULL [SELECT sr_dirac_skewness(1.0)]
sr_dirac_std_dev scalar Dirac delta distribution standard deviation (always 0) NULL [SELECT sr_dirac_std_dev(1.0)]
sr_dirac_variance scalar Dirac delta distribution variance (always 0) NULL [SELECT sr_dirac_variance(1.0)]
sr_dirichlet_entropy scalar Differential entropy of the Dirichlet distribution with concentrations alpha NULL [SELECT sr_dirichlet_entropy([1.0, 1.0])]
sr_dirichlet_ln_pdf scalar Log probability density of x on the simplex, given the concentration vector alpha; x must lie in (0,1)^k and sum to 1 NULL [SELECT sr_dirichlet_ln_pdf([0.1, 0.2, 0.3, 0.4], [0.1, 0.3, 0.5, 0.8])]
sr_dirichlet_mean scalar Mean vector of the Dirichlet distribution (alpha_i / alpha_0) given the concentration vector alpha NULL [SELECT sr_dirichlet_mean([1.0, 2.0, 3.0, 4.0])]
sr_dirichlet_pdf scalar Dirichlet probability density of x on the simplex, given the concentration vector alpha NULL [SELECT sr_dirichlet_pdf([0.5, 0.5], [1.0, 1.0])]
sr_dirichlet_variance scalar Covariance matrix of the Dirichlet distribution (row-major flattened LIST) given the concentration vector alpha NULL [SELECT sr_dirichlet_variance([1.0, 2.0])]
sr_discrete_uniform_cdf scalar Discrete uniform cumulative distribution function P(X <= x) NULL [SELECT sr_discrete_uniform_cdf(3, 1, 6)]
sr_discrete_uniform_entropy scalar Discrete uniform entropy NULL [SELECT sr_discrete_uniform_entropy(1, 6)]
sr_discrete_uniform_ln_pmf scalar Discrete uniform log probability mass at x NULL [SELECT sr_discrete_uniform_ln_pmf(2, 1, 6)]
sr_discrete_uniform_max scalar Discrete uniform maximum of the support (max) NULL [SELECT sr_discrete_uniform_max(1, 6)]
sr_discrete_uniform_mean scalar Discrete uniform mean NULL [SELECT sr_discrete_uniform_mean(1, 6)]
sr_discrete_uniform_median scalar Discrete uniform median NULL [SELECT sr_discrete_uniform_median(1, 6)]
sr_discrete_uniform_min scalar Discrete uniform minimum of the support (min) NULL [SELECT sr_discrete_uniform_min(1, 6)]
sr_discrete_uniform_mode scalar Discrete uniform mode NULL [SELECT sr_discrete_uniform_mode(1, 6)]
sr_discrete_uniform_pmf scalar Discrete uniform probability mass P(X = x) on the integer range [min, max] NULL [SELECT sr_discrete_uniform_pmf(2, 1, 6)]
sr_discrete_uniform_quantile scalar Discrete uniform quantile function: the x whose CDF equals p, for p in [0, 1] NULL [SELECT sr_discrete_uniform_quantile(0.5, 1, 6)]
sr_discrete_uniform_sf scalar Discrete uniform survival function P(X > x) NULL [SELECT sr_discrete_uniform_sf(3, 1, 6)]
sr_discrete_uniform_skewness scalar Discrete uniform skewness NULL [SELECT sr_discrete_uniform_skewness(1, 6)]
sr_discrete_uniform_std_dev scalar Discrete uniform standard deviation NULL [SELECT sr_discrete_uniform_std_dev(1, 6)]
sr_discrete_uniform_variance scalar Discrete uniform variance NULL [SELECT sr_discrete_uniform_variance(1, 6)]
sr_empirical_cdf aggregate Empirical CDF of a DOUBLE column evaluated at the second (constant) argument The sample is the whole column; an empty group yields NULL [SELECT sr_empirical_cdf(v, 2.0) FROM (VALUES (1.0), (2.0), (3.0), (4.0)) t(v)]
sr_empirical_entropy aggregate Empirical entropy of a DOUBLE column; always NULL, since statrs implements no entropy for the empirical distribution statrs' Distribution default returns None here, so the result is always NULL [SELECT sr_empirical_entropy(v) FROM (VALUES (1.0), (2.0), (3.0)) t(v)]
sr_empirical_max aggregate Empirical maximum of a DOUBLE column The sample is the whole column; an empty group yields NULL [SELECT sr_empirical_max(v) FROM (VALUES (1.0), (2.0), (3.0)) t(v)]
sr_empirical_mean aggregate Empirical mean of a DOUBLE column The sample is the whole column; an empty group yields NULL [SELECT sr_empirical_mean(v) FROM (VALUES (1.0), (2.0), (3.0)) t(v)]
sr_empirical_min aggregate Empirical minimum of a DOUBLE column The sample is the whole column; an empty group yields NULL [SELECT sr_empirical_min(v) FROM (VALUES (1.0), (2.0), (3.0)) t(v)]
sr_empirical_quantile aggregate Empirical quantile function of a DOUBLE column at the second (constant) probability in [0, 1] NULL [SELECT sr_empirical_quantile(v, 0.5) FROM (VALUES (1.0), (2.0), (3.0), (4.0)) t(v)]
sr_empirical_sf aggregate Empirical survival function of a DOUBLE column evaluated at the second (constant) argument NULL [SELECT sr_empirical_sf(v, 2.0) FROM (VALUES (1.0), (2.0), (3.0), (4.0)) t(v)]
sr_empirical_skewness aggregate Empirical skewness of a DOUBLE column; always NULL, since statrs implements no skewness for the empirical distribution statrs' Distribution default returns None here, so the result is always NULL [SELECT sr_empirical_skewness(v) FROM (VALUES (1.0), (2.0), (3.0)) t(v)]
sr_empirical_std_dev aggregate Empirical standard deviation of a DOUBLE column The sample is the whole column; an empty group yields NULL [SELECT sr_empirical_std_dev(v) FROM (VALUES (1.0), (2.0), (3.0)) t(v)]
sr_empirical_variance aggregate Empirical variance of a DOUBLE column The sample is the whole column; an empty group yields NULL [SELECT sr_empirical_variance(v) FROM (VALUES (1.0), (2.0), (3.0)) t(v)]
sr_erf scalar Error function erf(x) NULL [SELECT sr_erf(1.0)]
sr_erf_inv scalar Inverse error function, erf(x) = y solved for x NULL [SELECT sr_erf_inv(0.8427007929497149)]
sr_erfc scalar Complementary error function erfc(x) = 1 - erf(x) NULL [SELECT sr_erfc(1.0)]
sr_erfc_inv scalar Inverse complementary error function, erfc(x) = y solved for x NULL [SELECT sr_erfc_inv(0.15729920705028513)]
sr_erlang_cdf scalar Erlang cumulative distribution function P(X <= x) NULL [SELECT sr_erlang_cdf(1.0, 2, 2.0)]
sr_erlang_entropy scalar Erlang differential entropy (UBIGINT shape, DOUBLE rate) NULL [SELECT sr_erlang_entropy(2, 1.0)]
sr_erlang_ln_pdf scalar Erlang log-density at x NULL [SELECT sr_erlang_ln_pdf(1.0, 2, 2.0)]
sr_erlang_max scalar Erlang maximum of the support (positive infinity) NULL [SELECT sr_erlang_max(2, 1.0)]
sr_erlang_mean scalar Erlang mean (UBIGINT shape, DOUBLE rate) NULL [SELECT sr_erlang_mean(2, 1.0)]
sr_erlang_min scalar Erlang minimum of the support (0) NULL [SELECT sr_erlang_min(2, 1.0)]
sr_erlang_mode scalar Erlang mode (UBIGINT shape, DOUBLE rate) NULL [SELECT sr_erlang_mode(2, 1.0)]
sr_erlang_pdf scalar Erlang probability density at x (UBIGINT shape, DOUBLE rate) NULL [SELECT sr_erlang_pdf(1.0, 2, 2.0)]
sr_erlang_quantile scalar Erlang quantile function: the x whose CDF equals p, for p in [0, 1] NULL [SELECT sr_erlang_quantile(0.5, 2, 2.0)]
sr_erlang_sf scalar Erlang survival function P(X > x) NULL [SELECT sr_erlang_sf(1.0, 2, 2.0)]
sr_erlang_skewness scalar Erlang skewness (UBIGINT shape, DOUBLE rate) NULL [SELECT sr_erlang_skewness(2, 1.0)]
sr_erlang_std_dev scalar Erlang standard deviation (UBIGINT shape, DOUBLE rate) NULL [SELECT sr_erlang_std_dev(2, 1.0)]
sr_erlang_variance scalar Erlang variance (UBIGINT shape, DOUBLE rate) NULL [SELECT sr_erlang_variance(2, 1.0)]
sr_euler_mascheroni scalar The Euler-Mascheroni constant NULL [SELECT sr_euler_mascheroni()]
sr_exp_cdf scalar Exponential cumulative distribution function P(X <= x) NULL [SELECT sr_exp_cdf(1.0, 2.0)]
sr_exp_entropy scalar Exponential differential entropy, given the rate NULL [SELECT sr_exp_entropy(2.0)]
sr_exp_ln_pdf scalar Exponential log-density at x NULL [SELECT sr_exp_ln_pdf(1.0, 2.0)]
sr_exp_max scalar Exponential maximum of the support (positive infinity) NULL [SELECT sr_exp_max(2.0)]
sr_exp_mean scalar Exponential mean, given the rate NULL [SELECT sr_exp_mean(2.0)]
sr_exp_median scalar Exponential median, given the rate NULL [SELECT sr_exp_median(2.0)]
sr_exp_min scalar Exponential minimum of the support (0) NULL [SELECT sr_exp_min(2.0)]
sr_exp_mode scalar Exponential mode, given the rate NULL [SELECT sr_exp_mode(2.0)]
sr_exp_pdf scalar Exponential probability density at x, given the rate NULL [SELECT sr_exp_pdf(1.0, 2.0)]
sr_exp_quantile scalar Exponential quantile function: the x whose CDF equals p, for p in [0, 1] NULL [SELECT sr_exp_quantile(0.5, 2.0)]
sr_exp_sf scalar Exponential survival function P(X > x) NULL [SELECT sr_exp_sf(1.0, 2.0)]
sr_exp_skewness scalar Exponential skewness, given the rate NULL [SELECT sr_exp_skewness(2.0)]
sr_exp_std_dev scalar Exponential standard deviation, given the rate NULL [SELECT sr_exp_std_dev(2.0)]
sr_exp_variance scalar Exponential variance, given the rate NULL [SELECT sr_exp_variance(2.0)]
sr_exponential_integral scalar Exponential integral E_n(x) for n (UBIGINT) >= 0 and x >= 0; NULL where statrs leaves it undefined NULL [SELECT sr_exponential_integral(1.0, 0)]
sr_f64_prec scalar F64_PREC: the maximum relative precision 2^-53 of an IEEE 754 double NULL [SELECT sr_f64_prec()]
sr_f_oneway scalar One-way ANOVA over a LIST of sample LISTs: LIST [F statistic, p-value]; NaN policy codes as elsewhere NULL [SELECT sr_f_oneway([[1.0, 2.0, 3.0], [3.0, 4.0, 5.0]], 1.0)]
sr_factorial scalar Factorial of n, n as a UBIGINT (statrs' factorial::factorial) NULL [SELECT sr_factorial(10)]
sr_fisher_snedecor_cdf scalar Fisher-Snedecor (F) cumulative distribution function P(X <= x) NULL [SELECT sr_fisher_snedecor_cdf(1.0, 2.0, 3.0)]
sr_fisher_snedecor_entropy scalar Fisher-Snedecor (F) differential entropy, given the two degrees of freedom NULL [SELECT sr_fisher_snedecor_entropy(3.0, 5.0)]
sr_fisher_snedecor_ln_pdf scalar Fisher-Snedecor (F) log-density at x NULL [SELECT sr_fisher_snedecor_ln_pdf(1.0, 2.0, 3.0)]
sr_fisher_snedecor_max scalar Fisher-Snedecor (F) maximum of the support (positive infinity) NULL [SELECT sr_fisher_snedecor_max(3.0, 5.0)]
sr_fisher_snedecor_mean scalar Fisher-Snedecor (F) mean, given the two degrees of freedom NULL [SELECT sr_fisher_snedecor_mean(3.0, 5.0)]
sr_fisher_snedecor_min scalar Fisher-Snedecor (F) minimum of the support (0) NULL [SELECT sr_fisher_snedecor_min(3.0, 5.0)]
sr_fisher_snedecor_mode scalar Fisher-Snedecor (F) mode, given the two degrees of freedom NULL [SELECT sr_fisher_snedecor_mode(3.0, 5.0)]
sr_fisher_snedecor_pdf scalar Fisher-Snedecor (F) probability density at x, given the two degrees of freedom NULL [SELECT sr_fisher_snedecor_pdf(1.0, 2.0, 3.0)]
sr_fisher_snedecor_quantile scalar Fisher-Snedecor (F) quantile function: the x whose CDF equals p, for p in [0, 1] NULL [SELECT sr_fisher_snedecor_quantile(0.95, 2.0, 3.0)]
sr_fisher_snedecor_sf scalar Fisher-Snedecor (F) survival function P(X > x) NULL [SELECT sr_fisher_snedecor_sf(1.0, 2.0, 3.0)]
sr_fisher_snedecor_skewness scalar Fisher-Snedecor (F) skewness, given the two degrees of freedom NULL [SELECT sr_fisher_snedecor_skewness(3.0, 7.0)]
sr_fisher_snedecor_std_dev scalar Fisher-Snedecor (F) standard deviation, given the two degrees of freedom NULL [SELECT sr_fisher_snedecor_std_dev(3.0, 5.0)]
sr_fisher_snedecor_variance scalar Fisher-Snedecor (F) variance, given the two degrees of freedom NULL [SELECT sr_fisher_snedecor_variance(3.0, 5.0)]
sr_fishers_exact scalar Fisher's exact test p-value on a 2x2 contingency table given as a 4-entry UBIGINT LIST, row-major; alternative codes as elsewhere NULL [SELECT sr_fishers_exact([1, 2, 3, 4], 1.0)]
sr_fishers_exact_with_odds_ratio scalar Fisher's exact test on a 2x2 contingency table (4-entry UBIGINT LIST, row-major): LIST [odds ratio, p-value] NULL [SELECT sr_fishers_exact_with_odds_ratio([1, 2, 3, 4], 1.0)]
sr_gamma scalar Gamma function Γ(x) NULL [SELECT sr_gamma(5.0)]
sr_gamma_cdf scalar Gamma cumulative distribution function P(X <= x) NULL [SELECT sr_gamma_cdf(1.0, 2.0, 2.0)]
sr_gamma_entropy scalar Gamma differential entropy (shape/rate parameterization) NULL [SELECT sr_gamma_entropy(2.0, 1.0)]
sr_gamma_ln_pdf scalar Gamma log-density at x NULL [SELECT sr_gamma_ln_pdf(1.0, 2.0, 2.0)]
sr_gamma_lower_incomplete scalar Lower incomplete Gamma function γ(a, x), integrating from 0 to x NULL [SELECT sr_gamma_lower_incomplete(2.0, 1.0)]
sr_gamma_lower_regularized scalar Regularized lower incomplete Gamma function P(a, x) = γ(a,x)/Γ(a) NULL [SELECT sr_gamma_lower_regularized(2.0, 1.0)]
sr_gamma_max scalar Gamma maximum of the support (positive infinity) NULL [SELECT sr_gamma_max(2.0, 1.0)]
sr_gamma_mean scalar Gamma mean (shape/rate parameterization) NULL [SELECT sr_gamma_mean(2.0, 1.0)]
sr_gamma_min scalar Gamma minimum of the support (0) NULL [SELECT sr_gamma_min(2.0, 1.0)]
sr_gamma_mode scalar Gamma mode (shape/rate parameterization) NULL [SELECT sr_gamma_mode(2.0, 1.0)]
sr_gamma_pdf scalar Gamma probability density at x (shape/rate parameterization) NULL [SELECT sr_gamma_pdf(1.0, 2.0, 2.0)]
sr_gamma_quantile scalar Gamma quantile function: the x whose CDF equals p, for p in [0, 1] NULL [SELECT sr_gamma_quantile(0.5, 2.0, 2.0)]
sr_gamma_sf scalar Gamma survival function P(X > x) NULL [SELECT sr_gamma_sf(1.0, 2.0, 2.0)]
sr_gamma_skewness scalar Gamma skewness (shape/rate parameterization) NULL [SELECT sr_gamma_skewness(2.0, 1.0)]
sr_gamma_std_dev scalar Gamma standard deviation (shape/rate parameterization) NULL [SELECT sr_gamma_std_dev(2.0, 1.0)]
sr_gamma_upper_incomplete scalar Upper incomplete Gamma function Γ(a, x), integrating from x to infinity NULL [SELECT sr_gamma_upper_incomplete(2.0, 1.0)]
sr_gamma_upper_regularized scalar Regularized upper incomplete Gamma function Q(a, x) = Γ(a,x)/Γ(a) NULL [SELECT sr_gamma_upper_regularized(2.0, 1.0)]
sr_gamma_variance scalar Gamma variance (shape/rate parameterization) NULL [SELECT sr_gamma_variance(2.0, 1.0)]
sr_gen_log_spaced scalar Log-spaced sequence of length points between 10^start_exp and 10^stop_exp, returned as LIST(DOUBLE) NULL [SELECT sr_gen_log_spaced(5, 0.0, 2.0)]
sr_gen_periodic scalar First k points of statrs' infinite periodic generator (sampling rate, frequency, amplitude, phase, delay) NULL [SELECT sr_gen_periodic(8, 8.0, 1.0, 1.0, 0.0, 0)]
sr_gen_sawtooth scalar First k points of statrs' infinite sawtooth wave (period as BIGINT) NULL [SELECT sr_gen_sawtooth(8, 4, 1.0, 0.0, 0)]
sr_gen_sinusoidal scalar First k points of statrs' infinite sinusoidal generator (sampling rate, frequency, amplitude, mean, phase, delay) NULL [SELECT sr_gen_sinusoidal(8, 8.0, 1.0, 1.0, 0.0, 0.0, 0)]
sr_gen_square scalar First k points of statrs' infinite square wave (high/low durations as BIGINT) NULL [SELECT sr_gen_square(8, 2, 2, 1.0, 0.0, 0)]
sr_gen_triangle scalar First k points of statrs' infinite triangle wave (raise/fall durations as BIGINT) NULL [SELECT sr_gen_triangle(8, 2, 2, 1.0, 0.0, 0)]
sr_generalized_harmonic scalar Generalized harmonic number sum of 1/k^m for k = 1..n, n as a UBIGINT and m real NULL [SELECT sr_generalized_harmonic(10, 2.0)]
sr_geometric_cdf scalar Geometric cumulative distribution function P(X <= x) NULL [SELECT sr_geometric_cdf(2, 0.5)]
sr_geometric_dist_mean scalar Mean of the Geometric distribution, 1/p (named _dist to avoid clashing with the sr_geometric_mean aggregate over a column) NULL [SELECT sr_geometric_dist_mean(0.5)]
sr_geometric_entropy scalar Geometric entropy NULL [SELECT sr_geometric_entropy(0.5)]
sr_geometric_ln_pmf scalar Geometric log probability mass at x NULL [SELECT sr_geometric_ln_pmf(2, 0.5)]
sr_geometric_max scalar Geometric maximum of the support (u64::MAX, shown as 1.8e19) NULL [SELECT sr_geometric_max(0.5)]
sr_geometric_mean aggregate Geometric mean of a DOUBLE column, NULL when a value is negative or no row is non-NULL A negative value makes the statistic undefined, which comes back as NULL [SELECT sr_geometric_mean(x) FROM (VALUES (1.0), (2.0), (3.0)) t(x)]
sr_geometric_median scalar Geometric median NULL [SELECT sr_geometric_median(0.5)]
sr_geometric_min scalar Geometric minimum of the support (1) NULL [SELECT sr_geometric_min(0.5)]
sr_geometric_mode scalar Geometric mode NULL [SELECT sr_geometric_mode(0.5)]
sr_geometric_pmf scalar Geometric probability mass P(X = x) for the number of trials until the first success (statrs' support starts at 1) NULL [SELECT sr_geometric_pmf(2, 0.5)]
sr_geometric_quantile scalar Geometric quantile function: the x whose CDF equals p, for p in [0, 1] NULL [SELECT sr_geometric_quantile(0.5, 0.5)]
sr_geometric_sf scalar Geometric survival function P(X > x) NULL [SELECT sr_geometric_sf(2, 0.5)]
sr_geometric_skewness scalar Geometric skewness NULL [SELECT sr_geometric_skewness(0.5)]
sr_geometric_std_dev scalar Geometric standard deviation NULL [SELECT sr_geometric_std_dev(0.5)]
sr_geometric_variance scalar Geometric variance NULL [SELECT sr_geometric_variance(0.5)]
sr_gumbel_cdf scalar Gumbel cumulative distribution function P(X <= x) NULL [SELECT sr_gumbel_cdf(1.0, 0.0, 1.0)]
sr_gumbel_entropy scalar Gumbel (type-I extreme value) distribution differential entropy NULL [SELECT sr_gumbel_entropy(0.0, 1.0)]
sr_gumbel_ln_pdf scalar Gumbel log-density at x NULL [SELECT sr_gumbel_ln_pdf(1.0, 0.0, 1.0)]
sr_gumbel_max scalar Gumbel (type-I extreme value) distribution support maximum (positive infinity) NULL [SELECT sr_gumbel_max(0.0, 1.0)]
sr_gumbel_mean scalar Gumbel (type-I extreme value) distribution mean NULL [SELECT sr_gumbel_mean(0.0, 1.0)]
sr_gumbel_median scalar Gumbel (type-I extreme value) distribution median NULL [SELECT sr_gumbel_median(0.0, 1.0)]
sr_gumbel_min scalar Gumbel (type-I extreme value) distribution support minimum (negative infinity) NULL [SELECT sr_gumbel_min(0.0, 1.0)]
sr_gumbel_mode scalar Gumbel (type-I extreme value) distribution mode NULL [SELECT sr_gumbel_mode(0.0, 1.0)]
sr_gumbel_pdf scalar Gumbel (type-I extreme value) probability density at x, given location and scale NULL [SELECT sr_gumbel_pdf(1.0, 0.0, 1.0)]
sr_gumbel_quantile scalar Gumbel quantile function: the x whose CDF equals p, for p in [0, 1] NULL [SELECT sr_gumbel_quantile(0.5, 0.0, 1.0)]
sr_gumbel_sf scalar Gumbel survival function P(X > x) NULL [SELECT sr_gumbel_sf(1.0, 0.0, 1.0)]
sr_gumbel_skewness scalar Gumbel (type-I extreme value) distribution skewness NULL [SELECT sr_gumbel_skewness(0.0, 1.0)]
sr_gumbel_std_dev scalar Gumbel (type-I extreme value) distribution standard deviation NULL [SELECT sr_gumbel_std_dev(0.0, 1.0)]
sr_gumbel_variance scalar Gumbel (type-I extreme value) distribution variance NULL [SELECT sr_gumbel_variance(0.0, 1.0)]
sr_harmonic scalar Harmonic number H(n) = sum of 1/k for k = 1..n, n as a UBIGINT NULL [SELECT sr_harmonic(10)]
sr_harmonic_mean aggregate Harmonic mean of a DOUBLE column, NULL when a value is negative or no row is non-NULL A negative value makes the statistic undefined, which comes back as NULL [SELECT sr_harmonic_mean(x) FROM (VALUES (1.0), (2.0), (3.0)) t(x)]
sr_hypergeometric_cdf scalar Hypergeometric cumulative distribution function P(X <= x) NULL [SELECT sr_hypergeometric_cdf(2, 10, 5, 4)]
sr_hypergeometric_entropy scalar Hypergeometric entropy NULL [SELECT sr_hypergeometric_entropy(10, 5, 4)]
sr_hypergeometric_ln_pmf scalar Hypergeometric log probability mass at x NULL [SELECT sr_hypergeometric_ln_pmf(2, 10, 5, 4)]
sr_hypergeometric_max scalar Hypergeometric maximum of the support NULL [SELECT sr_hypergeometric_max(10, 5, 4)]
sr_hypergeometric_mean scalar Hypergeometric mean NULL [SELECT sr_hypergeometric_mean(10, 5, 4)]
sr_hypergeometric_min scalar Hypergeometric minimum of the support NULL [SELECT sr_hypergeometric_min(10, 5, 4)]
sr_hypergeometric_mode scalar Hypergeometric mode NULL [SELECT sr_hypergeometric_mode(10, 5, 4)]
sr_hypergeometric_pmf scalar Hypergeometric probability mass P(X = x): successes drawn without replacement (population, successes, draws as UBIGINT) NULL [SELECT sr_hypergeometric_pmf(2, 10, 5, 4)]
sr_hypergeometric_quantile scalar Hypergeometric quantile function: the x whose CDF equals p, for p in [0, 1] NULL [SELECT sr_hypergeometric_quantile(0.5, 10, 5, 4)]
sr_hypergeometric_sf scalar Hypergeometric survival function P(X > x) NULL [SELECT sr_hypergeometric_sf(2, 10, 5, 4)]
sr_hypergeometric_skewness scalar Hypergeometric skewness NULL [SELECT sr_hypergeometric_skewness(10, 5, 4)]
sr_hypergeometric_std_dev scalar Hypergeometric standard deviation NULL [SELECT sr_hypergeometric_std_dev(10, 5, 4)]
sr_hypergeometric_variance scalar Hypergeometric variance NULL [SELECT sr_hypergeometric_variance(10, 5, 4)]
sr_interquartile_range aggregate Interquartile range of a DOUBLE column, NULL when no row is non-NULL NULL [SELECT sr_interquartile_range(x) FROM (VALUES (2.0), (1.0), (3.0), (4.0)) t(x)]
sr_inv_beta_regularized scalar Inverse of the regularized incomplete Beta function: the x where I(x; a, b) = p NULL [SELECT sr_inv_beta_regularized(2.0, 3.0, 0.6875)]
sr_inv_digamma scalar Inverse digamma function, ψ(x) = y solved for x NULL [SELECT sr_inv_digamma(0.42278433509846713)]
sr_inverse_gamma_cdf scalar Inverse-gamma cumulative distribution function P(X <= x) NULL [SELECT sr_inverse_gamma_cdf(1.0, 2.0, 2.0)]
sr_inverse_gamma_entropy scalar Inverse-gamma differential entropy, given shape and scale NULL [SELECT sr_inverse_gamma_entropy(2.0, 1.0)]
sr_inverse_gamma_ln_pdf scalar Inverse-gamma log-density at x NULL [SELECT sr_inverse_gamma_ln_pdf(1.0, 2.0, 2.0)]
sr_inverse_gamma_max scalar Inverse-gamma maximum of the support (positive infinity) NULL [SELECT sr_inverse_gamma_max(2.0, 1.0)]
sr_inverse_gamma_mean scalar Inverse-gamma mean, given shape and scale NULL [SELECT sr_inverse_gamma_mean(2.0, 1.0)]
sr_inverse_gamma_min scalar Inverse-gamma minimum of the support (0) NULL [SELECT sr_inverse_gamma_min(2.0, 1.0)]
sr_inverse_gamma_mode scalar Inverse-gamma mode, given shape and scale NULL [SELECT sr_inverse_gamma_mode(2.0, 1.0)]
sr_inverse_gamma_pdf scalar Inverse-gamma probability density at x, given shape and scale NULL [SELECT sr_inverse_gamma_pdf(1.0, 2.0, 2.0)]
sr_inverse_gamma_quantile scalar Inverse-gamma quantile function: the x whose CDF equals p, for p in [0, 1] NULL [SELECT sr_inverse_gamma_quantile(0.5, 2.0, 2.0)]
sr_inverse_gamma_sf scalar Inverse-gamma survival function P(X > x) NULL [SELECT sr_inverse_gamma_sf(1.0, 2.0, 2.0)]
sr_inverse_gamma_skewness scalar Inverse-gamma skewness, given shape and scale NULL [SELECT sr_inverse_gamma_skewness(4.0, 1.0)]
sr_inverse_gamma_std_dev scalar Inverse-gamma standard deviation, given shape and scale NULL [SELECT sr_inverse_gamma_std_dev(3.0, 1.0)]
sr_inverse_gamma_variance scalar Inverse-gamma variance, given shape and scale NULL [SELECT sr_inverse_gamma_variance(3.0, 1.0)]
sr_kde_pdf scalar Kernel density estimate at x from a LIST(DOUBLE) sample; NULL bandwidth selects statrs' automatic bandwidth Gaussian kernel over a k-d tree; errors (empty sample, empty neighbourhood) fail the query [SELECT sr_kde_pdf(0.5, [0.0, 0.2, 0.7, 1.0], 0.3)]
sr_kernel_eval scalar Kernel function evaluation K(x) for a named kernel (gaussian, epanechnikov, triangular, tricube, quartic, uniform, cosine, logistic, sigmoid; case-insensitive) NULL [SELECT sr_kernel_eval('gaussian', 0.0)]
sr_kernel_eval_with_bandwidth scalar Kernel function with bandwidth scaling K(x / h) / h, for a named kernel (same names as sr_kernel_eval) NULL [SELECT sr_kernel_eval_with_bandwidth('gaussian', 0.0, 0.5)]
sr_kernel_support scalar Compact support [lo, hi] of a named kernel (same names as sr_kernel_eval); NULL for kernels with unbounded support NULL [SELECT sr_kernel_support('epanechnikov')]
sr_knn_pdf scalar K-nearest-neighbour density estimate at x from a LIST(DOUBLE) sample; NULL bandwidth selects the automatic k NULL [SELECT sr_knn_pdf(0.5, [0.0, 0.2, 0.7, 1.0], 0.3)]
sr_ks_onesample scalar One-sample Kolmogorov-Smirnov test of a LIST(DOUBLE) sample against a named distribution (normal / lognormal / exponential / gumbel / weibull / uniform) with its parameter LIST: LIST [KS statistic, p-value]; method 1 less 2 greater 3 two-sided exact 4 two-sided asymptotic 5 two-sided approximate NULL [SELECT sr_ks_onesample([1.0, 2.0, 3.0, 4.0], 'normal', [2.5, 1.0], 4.0, 1.0)]
sr_ks_twosample scalar Two-sample Kolmogorov-Smirnov test of two LIST(DOUBLE) samples: LIST [KS distance, p-value]; method 1 less 2 greater (asymptotic), 3 two-sided exact, 4 two-sided asymptotic NULL [SELECT sr_ks_twosample([1.0, 2.0, 3.0], [2.0, 3.0, 4.0], 4.0, 1.0)]
sr_laplace_cdf scalar Laplace cumulative distribution function P(X <= x) NULL [SELECT sr_laplace_cdf(1.0, 0.0, 1.0)]
sr_laplace_entropy scalar Laplace distribution differential entropy NULL [SELECT sr_laplace_entropy(0.0, 1.0)]
sr_laplace_ln_pdf scalar Laplace log-density at x NULL [SELECT sr_laplace_ln_pdf(1.0, 0.0, 1.0)]
sr_laplace_max scalar Laplace distribution support maximum (positive infinity) NULL [SELECT sr_laplace_max(0.0, 1.0)]
sr_laplace_mean scalar Laplace distribution mean NULL [SELECT sr_laplace_mean(0.0, 1.0)]
sr_laplace_median scalar Laplace distribution median NULL [SELECT sr_laplace_median(0.0, 1.0)]
sr_laplace_min scalar Laplace distribution support minimum (negative infinity) NULL [SELECT sr_laplace_min(0.0, 1.0)]
sr_laplace_mode scalar Laplace distribution mode NULL [SELECT sr_laplace_mode(0.0, 1.0)]
sr_laplace_pdf scalar Laplace probability density at x, given location and scale NULL [SELECT sr_laplace_pdf(1.0, 0.0, 1.0)]
sr_laplace_quantile scalar Laplace quantile function: the x whose CDF equals p, for p in [0, 1] NULL [SELECT sr_laplace_quantile(0.5, 0.0, 1.0)]
sr_laplace_sf scalar Laplace survival function P(X > x) NULL [SELECT sr_laplace_sf(1.0, 0.0, 1.0)]
sr_laplace_skewness scalar Laplace distribution skewness (always 0) NULL [SELECT sr_laplace_skewness(0.0, 1.0)]
sr_laplace_std_dev scalar Laplace distribution standard deviation NULL [SELECT sr_laplace_std_dev(0.0, 1.0)]
sr_laplace_variance scalar Laplace distribution variance NULL [SELECT sr_laplace_variance(0.0, 1.0)]
sr_levy_cdf scalar Lévy cumulative distribution function P(X <= x) NULL [SELECT sr_levy_cdf(1.0, 0.0, 1.0)]
sr_levy_entropy scalar Lévy distribution differential entropy NULL [SELECT sr_levy_entropy(0.0, 1.0)]
sr_levy_ln_pdf scalar Lévy log-density at x NULL [SELECT sr_levy_ln_pdf(1.0, 0.0, 1.0)]
sr_levy_max scalar Lévy distribution support maximum (positive infinity) NULL [SELECT sr_levy_max(0.0, 1.0)]
sr_levy_mean scalar Lévy distribution mean (undefined) NULL [SELECT sr_levy_mean(0.0, 1.0)]
sr_levy_median scalar Lévy distribution median NULL [SELECT sr_levy_median(0.0, 1.0)]
sr_levy_min scalar Lévy distribution support minimum (mu) NULL [SELECT sr_levy_min(0.0, 1.0)]
sr_levy_mode scalar Lévy distribution mode NULL [SELECT sr_levy_mode(0.0, 1.0)]
sr_levy_pdf scalar Lévy probability density at x, given location mu and scale c NULL [SELECT sr_levy_pdf(1.0, 0.0, 1.0)]
sr_levy_quantile scalar Lévy quantile function: the x whose CDF equals p, for p in [0, 1] statrs solves this one numerically (bisection), accuracy is lower than the closed forms [SELECT sr_levy_quantile(0.5, 0.0, 1.0)]
sr_levy_sf scalar Lévy survival function P(X > x) NULL [SELECT sr_levy_sf(1.0, 0.0, 1.0)]
sr_levy_skewness scalar Lévy distribution skewness (undefined) NULL [SELECT sr_levy_skewness(0.0, 1.0)]
sr_levy_std_dev scalar Lévy distribution standard deviation (undefined) NULL [SELECT sr_levy_std_dev(0.0, 1.0)]
sr_levy_variance scalar Lévy distribution variance (undefined) NULL [SELECT sr_levy_variance(0.0, 1.0)]
sr_ln_2_sqrt_e_over_pi scalar The constant ln(2*sqrt(e/PI)) NULL [SELECT sr_ln_2_sqrt_e_over_pi()]
sr_ln_beta scalar Natural logarithm of the Beta function, ln(B(a, b)) NULL [SELECT sr_ln_beta(2.0, 3.0)]
sr_ln_choose scalar Natural logarithm of the binomial coefficient C(n, k), n and k UBIGINTs NULL [SELECT sr_ln_choose(100, 50)]
sr_ln_factorial scalar Natural logarithm of n!, n as a UBIGINT NULL [SELECT sr_ln_factorial(100)]
sr_ln_gamma scalar Natural logarithm of the Gamma function, ln(Γ(x)) NULL [SELECT sr_ln_gamma(5.0)]
sr_ln_pi scalar The constant ln(PI) NULL [SELECT sr_ln_pi()]
sr_ln_sqrt_2pi scalar The constant ln(sqrt(2*PI)) NULL [SELECT sr_ln_sqrt_2pi()]
sr_ln_sqrt_2pie scalar The constant ln(sqrt(2PIe)) NULL [SELECT sr_ln_sqrt_2pie()]
sr_log_normal_cdf scalar Log-normal cumulative distribution function P(X <= x) NULL [SELECT sr_log_normal_cdf(1.0, 0.0, 1.0)]
sr_log_normal_entropy scalar Log-normal distribution differential entropy NULL [SELECT sr_log_normal_entropy(0.0, 1.0)]
sr_log_normal_ln_pdf scalar Log-normal log-density at x NULL [SELECT sr_log_normal_ln_pdf(1.0, 0.0, 1.0)]
sr_log_normal_max scalar Log-normal distribution support maximum (positive infinity) NULL [SELECT sr_log_normal_max(0.0, 1.0)]
sr_log_normal_mean scalar Log-normal distribution mean NULL [SELECT sr_log_normal_mean(0.0, 1.0)]
sr_log_normal_median scalar Log-normal distribution median NULL [SELECT sr_log_normal_median(0.0, 1.0)]
sr_log_normal_min scalar Log-normal distribution support minimum (0) NULL [SELECT sr_log_normal_min(0.0, 1.0)]
sr_log_normal_mode scalar Log-normal distribution mode NULL [SELECT sr_log_normal_mode(0.0, 1.0)]
sr_log_normal_pdf scalar Log-normal probability density at x (location and scale of ln X) NULL [SELECT sr_log_normal_pdf(1.0, 0.0, 1.0)]
sr_log_normal_quantile scalar Log-normal quantile function: the x whose CDF equals p, for p in [0, 1] NULL [SELECT sr_log_normal_quantile(0.5, 0.0, 1.0)]
sr_log_normal_sf scalar Log-normal survival function P(X > x) NULL [SELECT sr_log_normal_sf(1.0, 0.0, 1.0)]
sr_log_normal_skewness scalar Log-normal distribution skewness NULL [SELECT sr_log_normal_skewness(0.0, 1.0)]
sr_log_normal_std_dev scalar Log-normal distribution standard deviation NULL [SELECT sr_log_normal_std_dev(0.0, 1.0)]
sr_log_normal_variance scalar Log-normal distribution variance NULL [SELECT sr_log_normal_variance(0.0, 1.0)]
sr_logistic scalar Logistic (sigmoid) function 1 / (1 + exp(-p)) NULL [SELECT sr_logistic(0.0)]
sr_logit scalar Logit, the inverse sigmoid ln(p / (1 - p)); NULL unless p is in [0, 1], endpoints give infinity NULL [SELECT sr_logit(0.5)]
sr_lower_quartile aggregate First quartile (lower hinge) of a DOUBLE column, NULL when no row is non-NULL NULL [SELECT sr_lower_quartile(x) FROM (VALUES (2.0), (1.0), (3.0), (4.0)) t(x)]
sr_mannwhitneyu scalar Mann-Whitney U test of two LIST(DOUBLE) samples: LIST [U statistic, p-value]; method 1 automatic 2 exact 3 asymptotic incl. continuity correction 4 excl., plus the alternative codes NULL [SELECT sr_mannwhitneyu([1.0, 2.0, 3.0], [2.0, 3.0, 4.0], 1.0, 1.0)]
sr_max aggregate Maximum of a DOUBLE column (statrs' Statistics::max), NULL when no row is non-NULL NULL [SELECT sr_max(x) FROM (VALUES (0.0), (3.0), (-2.0)) t(x)]
sr_max_factorial scalar The maximum n such that factorial(n) does not overflow to infinity (statrs' factorial::MAX_FACTORIAL, as a UBIGINT) NULL [SELECT sr_max_factorial()]
sr_mean aggregate Arithmetic mean of a DOUBLE column, NULL when no row is non-NULL SQL NULL rows are skipped; statrs' NAN for an empty group becomes SQL NULL [SELECT sr_mean(x) FROM (VALUES (1.0), (2.0), (3.0)) t(x)]
sr_median aggregate Median of a DOUBLE column, NULL when no row is non-NULL Even-length inputs average the two middle values, statrs' own convention [SELECT sr_median(x) FROM (VALUES (3.0), (1.0), (2.0)) t(x)]
sr_min aggregate Minimum of a DOUBLE column (statrs' Statistics::min), NULL when no row is non-NULL NULL [SELECT sr_min(x) FROM (VALUES (0.0), (3.0), (-2.0)) t(x)]
sr_modulus scalar Canonical (Euclidean) modulus for f32, always in [0, divisor); NULL for a zero divisor NULL [SELECT sr_modulus(-1.0, 5.0)]
sr_multinomial_coefficient scalar Multinomial coefficient n! / (n1! n2! …) over a UBIGINT n and a count LIST(UBIGINT); NULL when the counts do not sum to n NULL [SELECT sr_multinomial_coefficient(5, [2, 2, 1])]
sr_multinomial_ln_pmf scalar Log probability mass of a count LIST(UBIGINT) under the multinomial distribution; -inf when the counts do not sum to n NULL [SELECT sr_multinomial_ln_pmf([0.5, 0.5], 2000, [1000, 1000])]
sr_multinomial_mean scalar Mean vector of the multinomial distribution (n * p_i) given category probabilities and the trial count (UBIGINT) NULL [SELECT sr_multinomial_mean([0.3, 0.7], 5)]
sr_multinomial_pmf scalar Multinomial probability mass of a count LIST(UBIGINT), given category probabilities and the trial count (UBIGINT) NULL [SELECT sr_multinomial_pmf([1.0, 2.0], 3, [1, 2])]
sr_multinomial_variance scalar Covariance matrix of the multinomial distribution (row-major flattened LIST) given category probabilities and the trial count (UBIGINT) NULL [SELECT sr_multinomial_variance([0.1, 0.3, 0.6], 10)]
sr_multivariate_normal_entropy scalar Differential entropy of the multivariate normal distribution given the mean and a row-major flattened covariance matrix NULL [SELECT sr_multivariate_normal_entropy([0.0, 0.0], [1.0, 0.0, 0.0, 1.0])]
sr_multivariate_normal_ln_pdf scalar Log probability density of x under a multivariate normal distribution with the given mean and a row-major flattened covariance matrix NULL [SELECT sr_multivariate_normal_ln_pdf([1.0, 1.0], [0.0, 0.0], [1.0, 0.0, 0.0, 1.0])]
sr_multivariate_normal_max scalar Upper bound of the multivariate normal support: a vector of +inf with the dimension of the mean NULL [SELECT sr_multivariate_normal_max([0.0, 0.0], [1.0, 0.0, 0.0, 1.0])]
sr_multivariate_normal_mean scalar Mean vector of the multivariate normal distribution given the mean and a row-major flattened covariance matrix NULL [SELECT sr_multivariate_normal_mean([0.0, 0.0], [1.0, 0.0, 0.0, 1.0])]
sr_multivariate_normal_min scalar Lower bound of the multivariate normal support: a vector of -inf with the dimension of the mean NULL [SELECT sr_multivariate_normal_min([0.0, 0.0], [1.0, 0.0, 0.0, 1.0])]
sr_multivariate_normal_mode scalar Mode vector of the multivariate normal distribution given the mean and a row-major flattened covariance matrix NULL [SELECT sr_multivariate_normal_mode([0.0, 0.0], [1.0, 0.0, 0.0, 1.0])]
sr_multivariate_normal_pdf scalar Multivariate normal probability density of x (LIST) given the mean and a row-major flattened covariance matrix NULL [SELECT sr_multivariate_normal_pdf([0.0, 0.0], [0.0, 0.0], [1.0, 0.0, 0.0, 1.0])]
sr_multivariate_normal_precision scalar Precision matrix (inverse of the covariance matrix, row-major flattened LIST) of the multivariate normal distribution NULL [SELECT sr_multivariate_normal_precision([0.0, 0.0], [1.0, 0.0, 0.0, 1.0])]
sr_multivariate_normal_variance scalar Covariance matrix of the multivariate normal distribution (row-major flattened LIST) given the mean and a row-major flattened covariance matrix NULL [SELECT sr_multivariate_normal_variance([0.0, 0.0], [1.0, 0.0, 0.0, 1.0])]
sr_multivariate_students_t_ln_pdf scalar Log probability density of x under a multivariate Student's t distribution, given location, a row-major flattened scale matrix and the degrees of freedom NULL [SELECT sr_multivariate_students_t_ln_pdf([1.0, 1.0], [0.0, 0.0], [1.0, 0.0, 0.0, 1.0], 4.0)]
sr_multivariate_students_t_max scalar Upper bound of the multivariate Student's t support: a vector of +inf with the dimension of the location NULL [SELECT sr_multivariate_students_t_max([0.0, 0.0], [1.0, 0.0, 0.0, 1.0], 3.0)]
sr_multivariate_students_t_mean scalar Mean vector of the multivariate Student's t distribution; NULL when the degrees of freedom is at most 1 NULL [SELECT sr_multivariate_students_t_mean([0.0, 0.0], [1.0, 0.0, 0.0, 1.0], 2.0)]
sr_multivariate_students_t_min scalar Lower bound of the multivariate Student's t support: a vector of -inf with the dimension of the location NULL [SELECT sr_multivariate_students_t_min([0.0, 0.0], [1.0, 0.0, 0.0, 1.0], 3.0)]
sr_multivariate_students_t_mode scalar Mode vector of the multivariate Student's t distribution given location, a row-major flattened scale matrix and the degrees of freedom NULL [SELECT sr_multivariate_students_t_mode([0.0, 0.0], [1.0, 0.0, 0.0, 1.0], 3.0)]
sr_multivariate_students_t_pdf scalar Multivariate Student's t probability density of x, given location, a row-major flattened scale matrix and the degrees of freedom NULL [SELECT sr_multivariate_students_t_pdf([0.0, 0.0], [0.0, 0.0], [1.0, 0.0, 0.0, 1.0], 3.0)]
sr_multivariate_students_t_precision scalar Precision matrix (inverse of the scale matrix, row-major flattened LIST) of the multivariate Student's t distribution NULL [SELECT sr_multivariate_students_t_precision([0.0, 0.0], [1.0, 0.0, 0.0, 1.0], 3.0)]
sr_multivariate_students_t_variance scalar Covariance matrix (row-major flattened LIST) of the multivariate Student's t distribution, scale * nu/(nu-2); NULL when the degrees of freedom is at most 2 NULL [SELECT sr_multivariate_students_t_variance([0.0, 0.0], [1.0, 0.0, 0.0, 1.0], 3.0)]
sr_negative_binomial_cdf scalar Negative-binomial cumulative distribution function P(X <= x) NULL [SELECT sr_negative_binomial_cdf(3, 2.0, 0.5)]
sr_negative_binomial_entropy scalar Negative-binomial entropy NULL [SELECT sr_negative_binomial_entropy(2.0, 0.5)]
sr_negative_binomial_ln_pmf scalar Negative-binomial log probability mass at x NULL [SELECT sr_negative_binomial_ln_pmf(3, 2.0, 0.5)]
sr_negative_binomial_max scalar Negative-binomial maximum of the support (u64::MAX, shown as 1.8e19) NULL [SELECT sr_negative_binomial_max(2.0, 0.5)]
sr_negative_binomial_mean scalar Negative-binomial mean NULL [SELECT sr_negative_binomial_mean(2.0, 0.5)]
sr_negative_binomial_min scalar Negative-binomial minimum of the support (0) NULL [SELECT sr_negative_binomial_min(2.0, 0.5)]
sr_negative_binomial_mode scalar Negative-binomial mode (statrs returns a real-valued Option) NULL [SELECT sr_negative_binomial_mode(2.0, 0.5)]
sr_negative_binomial_pmf scalar Negative-binomial probability mass P(X = x): failures before the r-th success (real r, success probability p) NULL [SELECT sr_negative_binomial_pmf(3, 2.0, 0.5)]
sr_negative_binomial_quantile scalar Negative-binomial quantile function: the x whose CDF equals p, for p in [0, 1] NULL [SELECT sr_negative_binomial_quantile(0.5, 2.0, 0.5)]
sr_negative_binomial_sf scalar Negative-binomial survival function P(X > x) NULL [SELECT sr_negative_binomial_sf(3, 2.0, 0.5)]
sr_negative_binomial_skewness scalar Negative-binomial skewness NULL [SELECT sr_negative_binomial_skewness(2.0, 0.5)]
sr_negative_binomial_std_dev scalar Negative-binomial standard deviation NULL [SELECT sr_negative_binomial_std_dev(2.0, 0.5)]
sr_negative_binomial_variance scalar Negative-binomial variance NULL [SELECT sr_negative_binomial_variance(2.0, 0.5)]
sr_normal_cdf scalar Normal (Gaussian) cumulative distribution function P(X <= x) NULL [SELECT sr_normal_cdf(1.96, 0.0, 1.0)]
sr_normal_entropy scalar Normal (Gaussian) distribution differential entropy NULL [SELECT sr_normal_entropy(0.0, 1.0)]
sr_normal_ln_pdf scalar Normal (Gaussian) log-density at x, given mean and standard deviation NULL [SELECT sr_normal_ln_pdf(0.0, 0.0, 1.0)]
sr_normal_max scalar Normal (Gaussian) distribution support maximum (positive infinity) NULL [SELECT sr_normal_max(0.0, 1.0)]
sr_normal_mean scalar Normal (Gaussian) distribution mean NULL [SELECT sr_normal_mean(0.0, 1.0)]
sr_normal_median scalar Normal (Gaussian) distribution median NULL [SELECT sr_normal_median(0.0, 1.0)]
sr_normal_min scalar Normal (Gaussian) distribution support minimum (negative infinity) NULL [SELECT sr_normal_min(0.0, 1.0)]
sr_normal_mode scalar Normal (Gaussian) distribution mode NULL [SELECT sr_normal_mode(0.0, 1.0)]
sr_normal_pdf scalar Normal (Gaussian) probability density at x, given mean and standard deviation NULL [SELECT sr_normal_pdf(0.0, 0.0, 1.0)]
sr_normal_quantile scalar Normal (Gaussian) quantile function: the x whose CDF equals p, for p in [0, 1] A probability outside [0, 1] is a query error rather than a clamped endpoint [SELECT sr_normal_quantile(0.975, 0.0, 1.0)]
sr_normal_sf scalar Normal (Gaussian) survival function P(X > x) NULL [SELECT sr_normal_sf(1.96, 0.0, 1.0)]
sr_normal_skewness scalar Normal (Gaussian) distribution skewness (always 0) NULL [SELECT sr_normal_skewness(0.0, 1.0)]
sr_normal_std_dev scalar Normal (Gaussian) distribution standard deviation NULL [SELECT sr_normal_std_dev(0.0, 1.0)]
sr_normal_variance scalar Normal (Gaussian) distribution variance NULL [SELECT sr_normal_variance(0.0, 1.0)]
sr_order_statistic aggregate k-th smallest value of a DOUBLE column (1-based, k as UBIGINT), NULL when k is outside the data range NULL [SELECT sr_order_statistic(x, 2) FROM (VALUES (3.0), (1.0), (2.0)) t(x)]
sr_pareto_cdf scalar Pareto cumulative distribution function P(X <= x) NULL [SELECT sr_pareto_cdf(2.0, 1.0, 2.0)]
sr_pareto_entropy scalar Pareto (type-I) differential entropy, given scale x_m and shape alpha NULL [SELECT sr_pareto_entropy(1.0, 2.0)]
sr_pareto_ln_pdf scalar Pareto log-density at x NULL [SELECT sr_pareto_ln_pdf(1.0, 1.0, 2.0)]
sr_pareto_max scalar Pareto (type-I) maximum of the support (positive infinity) NULL [SELECT sr_pareto_max(1.0, 2.0)]
sr_pareto_mean scalar Pareto (type-I) mean, given scale x_m and shape alpha NULL [SELECT sr_pareto_mean(1.0, 2.0)]
sr_pareto_median scalar Pareto (type-I) median, given scale x_m and shape alpha NULL [SELECT sr_pareto_median(1.0, 2.0)]
sr_pareto_min scalar Pareto (type-I) minimum of the support (the scale) NULL [SELECT sr_pareto_min(1.0, 2.0)]
sr_pareto_mode scalar Pareto (type-I) mode, given scale x_m and shape alpha NULL [SELECT sr_pareto_mode(1.0, 2.0)]
sr_pareto_pdf scalar Pareto (type-I) probability density at x, given scale x_m and shape alpha NULL [SELECT sr_pareto_pdf(1.0, 1.0, 2.0)]
sr_pareto_quantile scalar Pareto quantile function: the x whose CDF equals p, for p in [0, 1] NULL [SELECT sr_pareto_quantile(0.5, 1.0, 2.0)]
sr_pareto_sf scalar Pareto survival function P(X > x) NULL [SELECT sr_pareto_sf(2.0, 1.0, 2.0)]
sr_pareto_skewness scalar Pareto (type-I) skewness, given scale x_m and shape alpha NULL [SELECT sr_pareto_skewness(1.0, 4.0)]
sr_pareto_std_dev scalar Pareto (type-I) standard deviation, given scale x_m and shape alpha NULL [SELECT sr_pareto_std_dev(1.0, 3.0)]
sr_pareto_variance scalar Pareto (type-I) variance, given scale x_m and shape alpha NULL [SELECT sr_pareto_variance(1.0, 3.0)]
sr_percentile aggregate p-th percentile of a DOUBLE column (p as a UBIGINT in 0..=100), NULL when out of range Use sr_quantile for non-integer positions [SELECT sr_percentile(x, 50) FROM (VALUES (1.0), (2.0), (3.0), (4.0)) t(x)]
sr_poisson_cdf scalar Poisson cumulative distribution function P(X <= x) NULL [SELECT sr_poisson_cdf(2, 3.0)]
sr_poisson_entropy scalar Poisson entropy NULL [SELECT sr_poisson_entropy(3.0)]
sr_poisson_ln_pmf scalar Poisson log probability mass at x NULL [SELECT sr_poisson_ln_pmf(2, 3.0)]
sr_poisson_max scalar Poisson maximum of the support (u64::MAX, shown as 1.8e19) NULL [SELECT sr_poisson_max(3.0)]
sr_poisson_mean scalar Poisson mean NULL [SELECT sr_poisson_mean(3.0)]
sr_poisson_median scalar Poisson median NULL [SELECT sr_poisson_median(3.0)]
sr_poisson_min scalar Poisson minimum of the support (0) NULL [SELECT sr_poisson_min(3.0)]
sr_poisson_mode scalar Poisson mode NULL [SELECT sr_poisson_mode(3.0)]
sr_poisson_pmf scalar Poisson probability mass P(X = x), given the rate lambda NULL [SELECT sr_poisson_pmf(2, 3.0)]
sr_poisson_quantile scalar Poisson quantile function: the x whose CDF equals p, for p in [0, 1] NULL [SELECT sr_poisson_quantile(0.5, 3.0)]
sr_poisson_sf scalar Poisson survival function P(X > x) NULL [SELECT sr_poisson_sf(2, 3.0)]
sr_poisson_skewness scalar Poisson skewness NULL [SELECT sr_poisson_skewness(3.0)]
sr_poisson_std_dev scalar Poisson standard deviation NULL [SELECT sr_poisson_std_dev(3.0)]
sr_poisson_variance scalar Poisson variance NULL [SELECT sr_poisson_variance(3.0)]
sr_polynomial scalar Polynomial evaluation sum coeff[i] * x^i with the coefficient LIST in ascending order NULL [SELECT sr_polynomial(2.0, [1.0, 0.0, 3.0])]
sr_population_covariance aggregate Population covariance of two DOUBLE columns, NULL when no row is fully non-NULL A row with a NULL in either column is skipped entirely, keeping the two columns paired [SELECT sr_population_covariance(x, y) FROM (VALUES (0.0, -5.0), (3.0, 4.0), (-2.0, 10.0)) t(x, y)]
sr_population_std_dev aggregate Population standard deviation of a DOUBLE column, NULL when no row is non-NULL Single-row groups yield a real number here (dividing by N), unlike the sample family [SELECT sr_population_std_dev(x) FROM (VALUES (0.0), (3.0), (-2.0)) t(x)]
sr_population_variance aggregate Population variance of a DOUBLE column, NULL when no row is non-NULL Single-row groups yield a real number here (dividing by N), unlike the sample family [SELECT sr_population_variance(x) FROM (VALUES (0.0), (3.0), (-2.0)) t(x)]
sr_quadratic_mean aggregate Quadratic mean (root mean square) of a DOUBLE column, NULL when no row is non-NULL SQL NULL rows are skipped; statrs' NAN for an empty group becomes SQL NULL [SELECT sr_quadratic_mean(x) FROM (VALUES (1.0), (2.0), (3.0)) t(x)]
sr_quantile aggregate Tau quantile of a DOUBLE column, tau as the second (constant) argument, NULL when empty or tau is not in [0, 1] Write the tau argument as a literal; a NULL tau skips the row entirely, like any NULL input [SELECT sr_quantile(x, 0.5) FROM (VALUES (1.0), (2.0), (3.0), (4.0)) t(x)]
sr_ranks aggregate Ranks of a DOUBLE column as LIST(DOUBLE); method 1=average 2=min 3=max 4=first (statrs' tie breakers) Ties follow the chosen RankTieBreaker; an out-of-range method is a query error [SELECT sr_ranks(x, 1.0) FROM (VALUES (1.0), (3.0), (2.0), (2.0)) t(x)]
sr_sample_bernoulli scalar Draw k Bernoulli(p) samples (0/1) into a LIST(DOUBLE) NULL [SELECT len(sr_sample_bernoulli(0.5, 10))]
sr_sample_beta scalar Draw k Beta(shape_a, shape_b) samples into a LIST(DOUBLE) using statrs' rand integration NULL [SELECT len(sr_sample_beta(2.0, 3.0, 10))]
sr_sample_binomial scalar Draw k Binomial(p, UBIGINT n) samples into a LIST(UBIGINT) NULL [SELECT len(sr_sample_binomial(0.5, 10, 8))]
sr_sample_binomial_algorithm scalar Draw k Binomial(p, n) samples through statrs' BinomialSampler with an explicit algorithm (1 automatic, 2 inversion, 3 rejection) into a LIST(UBIGINT) NULL [SELECT len(sr_sample_binomial_algorithm(0.5, 10, 1.0, 8))]
sr_sample_categorical scalar Draw k Categorical(prob LIST) samples as category indices into a LIST(UBIGINT) NULL [SELECT len(sr_sample_categorical([1.0, 2.0, 1.0], 10))]
sr_sample_cauchy scalar Draw k Cauchy(location, scale) samples into a LIST(DOUBLE) NULL [SELECT len(sr_sample_cauchy(0.0, 1.0, 10))]
sr_sample_chi scalar Draw k Chi(UBIGINT freedom) samples into a LIST(DOUBLE) NULL [SELECT len(sr_sample_chi(2, 10))]
sr_sample_chi_squared scalar Draw k Chi-squared(freedom) samples into a LIST(DOUBLE) NULL [SELECT len(sr_sample_chi_squared(2.0, 10))]
sr_sample_dirac scalar Draw k Dirac(v) samples into a LIST(DOUBLE) NULL [SELECT sr_sample_dirac(3.0, 2)]
sr_sample_dirichlet scalar Draw k Dirichlet samples on the simplex (concentration LIST alpha) as a LIST of point LISTs, each summing to 1 NULL [SELECT len(sr_sample_dirichlet([1.0, 2.0], 4))]
sr_sample_discrete_uniform scalar Draw k DiscreteUniform(BIGINT min, max) samples into a LIST(BIGINT) NULL [SELECT len(sr_sample_discrete_uniform(1, 6, 10))]
sr_sample_empirical aggregate Draw k samples from the empirical distribution of a DOUBLE column into a LIST(DOUBLE); k is the second (constant) argument NULL [SELECT sr_sample_empirical(v, 5) FROM (VALUES (1.0), (2.0), (3.0)) t(v)]
sr_sample_erlang scalar Draw k Erlang(UBIGINT shape, DOUBLE rate) samples into a LIST(DOUBLE) NULL [SELECT len(sr_sample_erlang(2, 2.0, 10))]
sr_sample_exp scalar Draw k Exponential(rate) samples into a LIST(DOUBLE) NULL [SELECT len(sr_sample_exp(2.0, 10))]
sr_sample_fisher_snedecor scalar Draw k Fisher-Snedecor(f1, f2) samples into a LIST(DOUBLE) NULL [SELECT len(sr_sample_fisher_snedecor(2.0, 3.0, 10))]
sr_sample_gamma scalar Draw k Gamma(shape, rate) samples into a LIST(DOUBLE) NULL [SELECT len(sr_sample_gamma(2.0, 2.0, 10))]
sr_sample_geometric scalar Draw k Geometric(p) samples into a LIST(UBIGINT) NULL [SELECT len(sr_sample_geometric(0.5, 10))]
sr_sample_gumbel scalar Draw k Gumbel(location, scale) samples into a LIST(DOUBLE) NULL [SELECT len(sr_sample_gumbel(0.0, 1.0, 10))]
sr_sample_hypergeometric scalar Draw k Hypergeometric(population, successes, draws as UBIGINT) samples into a LIST(UBIGINT) NULL [SELECT len(sr_sample_hypergeometric(10, 5, 4, 8))]
sr_sample_inverse_gamma scalar Draw k InverseGamma(shape, scale) samples into a LIST(DOUBLE) NULL [SELECT len(sr_sample_inverse_gamma(2.0, 2.0, 10))]
sr_sample_laplace scalar Draw k Laplace(location, scale) samples into a LIST(DOUBLE) NULL [SELECT len(sr_sample_laplace(0.0, 1.0, 10))]
sr_sample_levy scalar Draw k Levy(mu, c) samples into a LIST(DOUBLE) NULL [SELECT len(sr_sample_levy(0.0, 1.0, 10))]
sr_sample_log_normal scalar Draw k LogNormal(location, scale) samples into a LIST(DOUBLE) NULL [SELECT len(sr_sample_log_normal(0.0, 1.0, 10))]
sr_sample_multinomial scalar Draw k multinomial count vectors (UBIGINT LISTs summing to n) given category probabilities and the trial count NULL [SELECT len(sr_sample_multinomial([0.3, 0.7], 10, 4))]
sr_sample_multivariate_normal scalar Draw k MultivariateNormal samples (mean LIST, row-major flattened covariance LIST) as a LIST of point LISTs NULL [SELECT len(sr_sample_multivariate_normal([0.0, 0.0], [1.0, 0.0, 0.0, 1.0], 4))]
sr_sample_multivariate_students_t scalar Draw k multivariate Student's t samples (location LIST, row-major flattened scale LIST, degrees of freedom) as a LIST of point LISTs NULL [SELECT len(sr_sample_multivariate_students_t([0.0, 0.0], [1.0, 0.0, 0.0, 1.0], 3.0, 4))]
sr_sample_negative_binomial scalar Draw k NegativeBinomial(r, p) samples into a LIST(UBIGINT) NULL [SELECT len(sr_sample_negative_binomial(2.0, 0.5, 10))]
sr_sample_normal scalar Draw k Normal(mean, std_dev) samples into a LIST(DOUBLE) NULL [SELECT len(sr_sample_normal(0.0, 1.0, 10))]
sr_sample_pareto scalar Draw k Pareto(scale, shape) samples into a LIST(DOUBLE) NULL [SELECT len(sr_sample_pareto(1.0, 2.0, 10))]
sr_sample_poisson scalar Draw k Poisson(lambda) samples into a LIST(UBIGINT) NULL [SELECT len(sr_sample_poisson(3.0, 10))]
sr_sample_students_t scalar Draw k Student's t(location, scale, freedom) samples into a LIST(DOUBLE) NULL [SELECT len(sr_sample_students_t(0.0, 1.0, 2.0, 10))]
sr_sample_triangular scalar Draw k Triangular(min, max, mode) samples into a LIST(DOUBLE) NULL [SELECT len(sr_sample_triangular(0.0, 2.0, 1.0, 10))]
sr_sample_uniform scalar Draw k continuous Uniform(min, max) samples into a LIST(DOUBLE) NULL [SELECT len(sr_sample_uniform(0.0, 1.0, 10))]
sr_sample_weibull scalar Draw k Weibull(shape, scale) samples into a LIST(DOUBLE) NULL [SELECT len(sr_sample_weibull(1.0, 1.0, 10))]
sr_skewness aggregate Sample skewness of a DOUBLE column (statrs' OnlineMoments<3>, m3/m2^1.5), NULL when fewer than two rows are non-NULL; constant columns give 0 Fewer than two observations have no skewness; a zero-variance column is defined as 0, following statrs [SELECT sr_skewness(x) FROM (VALUES (2.0), (4.0), (4.0), (4.0), (5.0), (5.0), (7.0), (9.0)) t(x)]
sr_skewtest scalar Skewness z-test of a LIST(DOUBLE) sample: LIST [z statistic, p-value]; same alternative and NaN-policy codes as sr_ttest_onesample NULL [SELECT sr_skewtest([1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0], 1.0, 1.0)]
sr_sqrt_2pi scalar The constant sqrt(2*PI), statrs' normalizing factor for the Gaussian density NULL [SELECT sr_sqrt_2pi()]
sr_std_dev aggregate Sample standard deviation of a DOUBLE column (Bessel-corrected), NULL when fewer than two rows are non-NULL One value has no sample standard deviation; the result is NULL, not 0 [SELECT sr_std_dev(x) FROM (VALUES (0.0), (3.0), (-2.0)) t(x)]
sr_students_t_cdf scalar Student's t cumulative distribution function P(X <= x) NULL [SELECT sr_students_t_cdf(1.0, 0.0, 1.0, 2.0)]
sr_students_t_entropy scalar Student's t distribution differential entropy NULL [SELECT sr_students_t_entropy(0.0, 1.0, 10.0)]
sr_students_t_ln_pdf scalar Student's t log-density at x NULL [SELECT sr_students_t_ln_pdf(1.0, 0.0, 1.0, 2.0)]
sr_students_t_max scalar Student's t distribution support maximum (positive infinity) NULL [SELECT sr_students_t_max(0.0, 1.0, 10.0)]
sr_students_t_mean scalar Student's t distribution mean NULL [SELECT sr_students_t_mean(0.0, 1.0, 2.0)]
sr_students_t_median scalar Student's t distribution median NULL [SELECT sr_students_t_median(0.0, 1.0, 10.0)]
sr_students_t_min scalar Student's t distribution support minimum (negative infinity) NULL [SELECT sr_students_t_min(0.0, 1.0, 10.0)]
sr_students_t_mode scalar Student's t distribution mode NULL [SELECT sr_students_t_mode(0.0, 1.0, 10.0)]
sr_students_t_pdf scalar Student's t probability density at x, given location, scale and degrees of freedom NULL [SELECT sr_students_t_pdf(1.0, 0.0, 1.0, 2.0)]
sr_students_t_quantile scalar Student's t quantile function: the x whose CDF equals p, for p in [0, 1] statrs solves this one numerically (bisection), accuracy is lower than the closed forms [SELECT sr_students_t_quantile(0.975, 0.0, 1.0, 10.0)]
sr_students_t_sf scalar Student's t survival function P(X > x) NULL [SELECT sr_students_t_sf(1.0, 0.0, 1.0, 2.0)]
sr_students_t_skewness scalar Student's t distribution skewness NULL [SELECT sr_students_t_skewness(0.0, 1.0, 10.0)]
sr_students_t_std_dev scalar Student's t distribution standard deviation NULL [SELECT sr_students_t_std_dev(0.0, 1.0, 10.0)]
sr_students_t_variance scalar Student's t distribution variance NULL [SELECT sr_students_t_variance(0.0, 1.0, 10.0)]
sr_triangular_cdf scalar Triangular cumulative distribution function P(X <= x) NULL [SELECT sr_triangular_cdf(1.0, 0.0, 2.0, 1.0)]
sr_triangular_entropy scalar Triangular distribution differential entropy NULL [SELECT sr_triangular_entropy(0.0, 2.0, 1.0)]
sr_triangular_ln_pdf scalar Triangular log-density at x NULL [SELECT sr_triangular_ln_pdf(1.0, 0.0, 2.0, 1.0)]
sr_triangular_max scalar Triangular distribution support maximum (max) NULL [SELECT sr_triangular_max(0.0, 2.0, 1.0)]
sr_triangular_mean scalar Triangular distribution mean NULL [SELECT sr_triangular_mean(0.0, 2.0, 1.0)]
sr_triangular_median scalar Triangular distribution median NULL [SELECT sr_triangular_median(0.0, 2.0, 1.0)]
sr_triangular_min scalar Triangular distribution support minimum (min) NULL [SELECT sr_triangular_min(0.0, 2.0, 1.0)]
sr_triangular_mode scalar Triangular distribution mode NULL [SELECT sr_triangular_mode(0.0, 2.0, 1.0)]
sr_triangular_pdf scalar Triangular probability density at x, given min, max and mode NULL [SELECT sr_triangular_pdf(1.0, 0.0, 2.0, 1.0)]
sr_triangular_quantile scalar Triangular quantile function: the x whose CDF equals p, for p in [0, 1] NULL [SELECT sr_triangular_quantile(0.5, 0.0, 2.0, 1.0)]
sr_triangular_sf scalar Triangular survival function P(X > x) NULL [SELECT sr_triangular_sf(1.0, 0.0, 2.0, 1.0)]
sr_triangular_skewness scalar Triangular distribution skewness NULL [SELECT sr_triangular_skewness(0.0, 2.0, 1.0)]
sr_triangular_std_dev scalar Triangular distribution standard deviation NULL [SELECT sr_triangular_std_dev(0.0, 2.0, 1.0)]
sr_triangular_variance scalar Triangular distribution variance NULL [SELECT sr_triangular_variance(0.0, 2.0, 1.0)]
sr_ttest_onesample scalar One-sample t-test of a LIST(DOUBLE) sample against popmean: LIST [t statistic, p-value]; alternative 1 two-sided 2 less 3 greater, NaN policy 1 propagate 2 emit 3 error NULL [SELECT sr_ttest_onesample([1.0, 2.0, 3.0, 4.0], 2.5, 1.0, 1.0)]
sr_uniform_cdf scalar Continuous uniform cumulative distribution function P(X <= x) NULL [SELECT sr_uniform_cdf(0.5, 0.0, 1.0)]
sr_uniform_entropy scalar Continuous uniform distribution differential entropy NULL [SELECT sr_uniform_entropy(0.0, 1.0)]
sr_uniform_ln_pdf scalar Continuous uniform log-density at x NULL [SELECT sr_uniform_ln_pdf(0.5, 0.0, 1.0)]
sr_uniform_max scalar Continuous uniform distribution support maximum (max) NULL [SELECT sr_uniform_max(0.0, 1.0)]
sr_uniform_mean scalar Continuous uniform distribution mean NULL [SELECT sr_uniform_mean(0.0, 1.0)]
sr_uniform_median scalar Continuous uniform distribution median NULL [SELECT sr_uniform_median(0.0, 1.0)]
sr_uniform_min scalar Continuous uniform distribution support minimum (min) NULL [SELECT sr_uniform_min(0.0, 1.0)]
sr_uniform_mode scalar Continuous uniform distribution mode NULL [SELECT sr_uniform_mode(0.0, 1.0)]
sr_uniform_pdf scalar Continuous uniform probability density at x on [min, max] NULL [SELECT sr_uniform_pdf(0.5, 0.0, 1.0)]
sr_uniform_quantile scalar Continuous uniform quantile function: the x whose CDF equals p, for p in [0, 1] NULL [SELECT sr_uniform_quantile(0.25, 0.0, 1.0)]
sr_uniform_sf scalar Continuous uniform survival function P(X > x) NULL [SELECT sr_uniform_sf(0.5, 0.0, 1.0)]
sr_uniform_skewness scalar Continuous uniform distribution skewness (always 0) NULL [SELECT sr_uniform_skewness(0.0, 1.0)]
sr_uniform_std_dev scalar Continuous uniform distribution standard deviation NULL [SELECT sr_uniform_std_dev(0.0, 1.0)]
sr_uniform_variance scalar Continuous uniform distribution variance NULL [SELECT sr_uniform_variance(0.0, 1.0)]
sr_upper_quartile aggregate Third quartile (upper hinge) of a DOUBLE column, NULL when no row is non-NULL NULL [SELECT sr_upper_quartile(x) FROM (VALUES (2.0), (1.0), (3.0), (4.0)) t(x)]
sr_variance aggregate Sample variance of a DOUBLE column (Bessel-corrected), NULL when fewer than two rows are non-NULL One value has no sample variance; the result is NULL, not 0 [SELECT sr_variance(x) FROM (VALUES (0.0), (3.0), (-2.0)) t(x)]
sr_weibull_cdf scalar Weibull cumulative distribution function P(X <= x) NULL [SELECT sr_weibull_cdf(1.0, 1.0, 1.0)]
sr_weibull_entropy scalar Weibull differential entropy, given shape k and scale lambda NULL [SELECT sr_weibull_entropy(1.0, 1.0)]
sr_weibull_ln_pdf scalar Weibull log-density at x NULL [SELECT sr_weibull_ln_pdf(1.0, 1.0, 1.0)]
sr_weibull_max scalar Weibull maximum of the support (positive infinity) NULL [SELECT sr_weibull_max(1.0, 1.0)]
sr_weibull_mean scalar Weibull mean, given shape k and scale lambda NULL [SELECT sr_weibull_mean(1.0, 1.0)]
sr_weibull_median scalar Weibull median, given shape k and scale lambda NULL [SELECT sr_weibull_median(1.0, 1.0)]
sr_weibull_min scalar Weibull minimum of the support (0) NULL [SELECT sr_weibull_min(1.0, 1.0)]
sr_weibull_mode scalar Weibull mode, given shape k and scale lambda NULL [SELECT sr_weibull_mode(2.0, 1.0)]
sr_weibull_pdf scalar Weibull probability density at x, given shape and scale NULL [SELECT sr_weibull_pdf(1.0, 1.0, 1.0)]
sr_weibull_quantile scalar Weibull quantile function: the x whose CDF equals p, for p in [0, 1] NULL [SELECT sr_weibull_quantile(0.5, 1.0, 1.0)]
sr_weibull_sf scalar Weibull survival function P(X > x) NULL [SELECT sr_weibull_sf(1.0, 1.0, 1.0)]
sr_weibull_skewness scalar Weibull skewness, given shape k and scale lambda NULL [SELECT sr_weibull_skewness(1.0, 1.0)]
sr_weibull_std_dev scalar Weibull standard deviation, given shape k and scale lambda NULL [SELECT sr_weibull_std_dev(1.0, 1.0)]
sr_weibull_variance scalar Weibull variance, given shape k and scale lambda NULL [SELECT sr_weibull_variance(1.0, 1.0)]

Overloaded Functions

This extension does not add any function overloads.

Added Types

This extension does not add any types.

Added Settings

This extension does not add any settings.