Chi-squared functions in the Stochastic DuckDB extension
Function category
Chi-squared
21 functionsChi-squared distribution — sum of k squared standard normals. Used in goodness-of-fit and variance tests.
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
degrees_of_freedom
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
x
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Computes the cumulative distribution function (CDF) of the chi_squared distribution. Returns the probability that a random variable X is less than or equal to x.
SELECT dist_chi_squared_cdf(5, 3.0);
Output
| dist_chi_squared_cdf(5, 3.0) |
|---|
| 0.3000141641213725 |
Related functions
- dist_chi_squared_sample() — Generates random samples from the chi_squared distribution with specified parameters
- 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_mean() — Returns the mean (μ) of the chi_squared distribution, which is the first moment
- dist_chi_squared_stddev() — Returns the standard deviation (σ) of the chi_squared distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
degrees_of_freedom
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
x
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Computes the complementary cumulative distribution function (1 - CDF) of the chi_squared distribution. Returns the probability that X > x, equivalent to the survival function.
SELECT dist_chi_squared_cdf_complement(5, 3.0);
Output
| dist_chi_squared_cdf_complement(5, 3.0) |
|---|
| 0.6999858358786275 |
Related functions
- dist_chi_squared_sample() — Generates random samples from the chi_squared distribution with specified parameters
- dist_chi_squared_pdf() — Computes the probability density function (PDF) of the chi_squared distribution
- dist_chi_squared_cdf() — Computes the cumulative distribution function (CDF) of the chi_squared distribution
- dist_chi_squared_quantile() — Computes the quantile function (inverse CDF) 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_stddev() — Returns the standard deviation (σ) of the chi_squared distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
degrees_of_freedom
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
x
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Computes the cumulative hazard function of the chi_squared distribution.
SELECT dist_chi_squared_chf(5, 3.0);
Output
| dist_chi_squared_chf(5, 3.0) |
|---|
| 0.3566951786025554 |
Related functions
- dist_chi_squared_sample() — Generates random samples from the chi_squared distribution with specified parameters
- dist_chi_squared_pdf() — Computes the probability density function (PDF) of the chi_squared distribution
- dist_chi_squared_cdf() — Computes the cumulative distribution function (CDF) of the chi_squared distribution
- dist_chi_squared_quantile() — Computes the quantile function (inverse CDF) 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_stddev() — Returns the standard deviation (σ) of the chi_squared distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
degrees_of_freedom
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
x
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Computes the hazard function of the chi_squared distribution.
SELECT dist_chi_squared_hazard(5, 3.0);
Output
| dist_chi_squared_hazard(5, 3.0) |
|---|
| 0.2202620708892502 |
Related functions
- dist_chi_squared_sample() — Generates random samples from the chi_squared distribution with specified parameters
- dist_chi_squared_pdf() — Computes the probability density function (PDF) of the chi_squared distribution
- dist_chi_squared_cdf() — Computes the cumulative distribution function (CDF) of the chi_squared distribution
- dist_chi_squared_quantile() — Computes the quantile function (inverse CDF) 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_stddev() — Returns the standard deviation (σ) of the chi_squared distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
degrees_of_freedom
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the kurtosis of the chi_squared distribution.
SELECT dist_chi_squared_kurtosis(5);
Output
| dist_chi_squared_kurtosis(5) |
|---|
| 5.4 |
Related functions
- dist_chi_squared_sample() — Generates random samples from the chi_squared distribution with specified parameters
- dist_chi_squared_pdf() — Computes the probability density function (PDF) of the chi_squared distribution
- dist_chi_squared_cdf() — Computes the cumulative distribution function (CDF) of the chi_squared distribution
- dist_chi_squared_quantile() — Computes the quantile function (inverse CDF) 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_stddev() — Returns the standard deviation (σ) of the chi_squared distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
degrees_of_freedom
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the excess kurtosis of the chi_squared distribution.
SELECT dist_chi_squared_kurtosis_excess(5);
Output
| dist_chi_squared_kurtosis_excess(5) |
|---|
| 2.4 |
Related functions
- dist_chi_squared_sample() — Generates random samples from the chi_squared distribution with specified parameters
- dist_chi_squared_pdf() — Computes the probability density function (PDF) of the chi_squared distribution
- dist_chi_squared_cdf() — Computes the cumulative distribution function (CDF) of the chi_squared distribution
- dist_chi_squared_quantile() — Computes the quantile function (inverse CDF) 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_stddev() — Returns the standard deviation (σ) of the chi_squared distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
degrees_of_freedom
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
x
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Computes the natural logarithm of the cumulative distribution function (CDF) of the chi_squared distribution. Returns the logarithm of the probability that a random variable X is less than or equal to x.
SELECT dist_chi_squared_log_cdf(5, 3.0);
Output
| dist_chi_squared_log_cdf(5, 3.0) |
|---|
| -1.203925591702561 |
Related functions
- dist_chi_squared_sample() — Generates random samples from the chi_squared distribution with specified parameters
- dist_chi_squared_pdf() — Computes the probability density function (PDF) of the chi_squared distribution
- dist_chi_squared_cdf() — Computes the cumulative distribution function (CDF) of the chi_squared distribution
- dist_chi_squared_quantile() — Computes the quantile function (inverse CDF) 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_stddev() — Returns the standard deviation (σ) of the chi_squared distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
degrees_of_freedom
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
x
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Computes the natural logarithm of the complementary cumulative distribution function (1 - CDF) of the chi_squared distribution. Returns the logarithm of the probability that X > x, equivalent to the survival function.
SELECT dist_chi_squared_log_cdf_complement(5, 3.0);
Output
| dist_chi_squared_log_cdf_complement(5, 3.0) |
|---|
| -0.3566951786025554 |
Related functions
- dist_chi_squared_sample() — Generates random samples from the chi_squared distribution with specified parameters
- dist_chi_squared_pdf() — Computes the probability density function (PDF) of the chi_squared distribution
- dist_chi_squared_cdf() — Computes the cumulative distribution function (CDF) of the chi_squared distribution
- dist_chi_squared_quantile() — Computes the quantile function (inverse CDF) 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_stddev() — Returns the standard deviation (σ) of the chi_squared distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
degrees_of_freedom
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
x
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Computes the natural logarithm of the probability density function (log-PDF) of the chi_squared distribution. Useful for numerical stability when dealing with very small probabilities.
SELECT dist_chi_squared_log_pdf(5, 3.0);
Output
| dist_chi_squared_log_pdf(5, 3.0) |
|---|
| -1.8696323888706177 |
Related functions
- dist_chi_squared_sample() — Generates random samples from the chi_squared distribution with specified parameters
- dist_chi_squared_pdf() — Computes the probability density function (PDF) of the chi_squared distribution
- dist_chi_squared_cdf() — Computes the cumulative distribution function (CDF) of the chi_squared distribution
- dist_chi_squared_quantile() — Computes the quantile function (inverse CDF) 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_stddev() — Returns the standard deviation (σ) of the chi_squared distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
degrees_of_freedom
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the mean (μ) of the chi_squared distribution, which is the first moment.
SELECT dist_chi_squared_mean(5);
Output
| dist_chi_squared_mean(5) |
|---|
| 5.0 |
Related functions
- dist_chi_squared_sample() — Generates random samples from the chi_squared distribution with specified parameters
- dist_chi_squared_pdf() — Computes the probability density function (PDF) of the chi_squared distribution
- dist_chi_squared_cdf() — Computes the cumulative distribution function (CDF) of the chi_squared distribution
- dist_chi_squared_quantile() — Computes the quantile function (inverse CDF) of the chi_squared distribution
- dist_chi_squared_stddev() — Returns the standard deviation (σ) of the chi_squared distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
degrees_of_freedom
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the median (50th percentile) of the chi_squared distribution, which equals the mean.
SELECT dist_chi_squared_median(5);
Output
| dist_chi_squared_median(5) |
|---|
| 4.351460191095527 |
Related functions
- dist_chi_squared_sample() — Generates random samples from the chi_squared distribution with specified parameters
- dist_chi_squared_pdf() — Computes the probability density function (PDF) of the chi_squared distribution
- dist_chi_squared_cdf() — Computes the cumulative distribution function (CDF) of the chi_squared distribution
- dist_chi_squared_quantile() — Computes the quantile function (inverse CDF) 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_stddev() — Returns the standard deviation (σ) of the chi_squared distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
degrees_of_freedom
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the mode (most likely value) of the chi_squared distribution, which equals the mean.
SELECT dist_chi_squared_mode(5);
Output
| dist_chi_squared_mode(5) |
|---|
| 3.0 |
Related functions
- dist_chi_squared_sample() — Generates random samples from the chi_squared distribution with specified parameters
- dist_chi_squared_pdf() — Computes the probability density function (PDF) of the chi_squared distribution
- dist_chi_squared_cdf() — Computes the cumulative distribution function (CDF) of the chi_squared distribution
- dist_chi_squared_quantile() — Computes the quantile function (inverse CDF) 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_stddev() — Returns the standard deviation (σ) of the chi_squared distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
degrees_of_freedom
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
x
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Computes the probability density function (PDF) of the chi_squared distribution. Returns the probability densityat point x for a chi_squared distribution with specified parameters.
SELECT dist_chi_squared_pdf(5, 3.0);
Output
| dist_chi_squared_pdf(5, 3.0) |
|---|
| 0.1541803298037693 |
Related functions
- dist_chi_squared_sample() — Generates random samples from the chi_squared distribution with specified parameters
- dist_chi_squared_cdf() — Computes the cumulative distribution function (CDF) of the chi_squared distribution
- dist_chi_squared_quantile() — Computes the quantile function (inverse CDF) 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_stddev() — Returns the standard deviation (σ) of the chi_squared distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
degrees_of_freedom
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
p
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Computes the quantile function (inverse CDF) of the chi_squared distribution. Returns the value x such that P(X ≤ x) = p, where p is the cumulative probability.
SELECT dist_chi_squared_quantile(5, 0.95);
Output
| dist_chi_squared_quantile(5, 0.95) |
|---|
| 11.070497693516351 |
Related functions
- dist_chi_squared_sample() — Generates random samples from the chi_squared distribution with specified parameters
- dist_chi_squared_pdf() — Computes the probability density function (PDF) of the chi_squared distribution
- dist_chi_squared_cdf() — Computes the cumulative distribution function (CDF) 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_stddev() — Returns the standard deviation (σ) of the chi_squared distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
degrees_of_freedom
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
p
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Computes the complementary quantile function of the chi_squared distribution. Returns the value x such that P(X > x) = p, useful for computing upper tail quantiles.
SELECT dist_chi_squared_quantile_complement(5, 0.05);
Output
| dist_chi_squared_quantile_complement(5, 0.05) |
|---|
| 11.070497693516355 |
Related functions
- dist_chi_squared_sample() — Generates random samples from the chi_squared distribution with specified parameters
- dist_chi_squared_pdf() — Computes the probability density function (PDF) of the chi_squared distribution
- dist_chi_squared_cdf() — Computes the cumulative distribution function (CDF) of the chi_squared distribution
- dist_chi_squared_quantile() — Computes the quantile function (inverse CDF) 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_stddev() — Returns the standard deviation (σ) of the chi_squared distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
degrees_of_freedom
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the range of the chi_squared distribution.
SELECT dist_chi_squared_range(5);
Output
| dist_chi_squared_range(5) |
|---|
| (0.0, inf) |
Related functions
- dist_chi_squared_sample() — Generates random samples from the chi_squared distribution with specified parameters
- dist_chi_squared_pdf() — Computes the probability density function (PDF) of the chi_squared distribution
- dist_chi_squared_cdf() — Computes the cumulative distribution function (CDF) of the chi_squared distribution
- dist_chi_squared_quantile() — Computes the quantile function (inverse CDF) 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_stddev() — Returns the standard deviation (σ) of the chi_squared distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
degrees_of_freedom
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Generates random samples from the chi_squared distribution with specified parameters.
SELECT dist_chi_squared_sample(5);
Output
| dist_chi_squared_sample(5) |
|---|
| 5.125173105199968 |
Related functions
- dist_chi_squared_pdf() — Computes the probability density function (PDF) of the chi_squared distribution
- dist_chi_squared_cdf() — Computes the cumulative distribution function (CDF) of the chi_squared distribution
- dist_chi_squared_quantile() — Computes the quantile function (inverse CDF) 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_stddev() — Returns the standard deviation (σ) of the chi_squared distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
degrees_of_freedom
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the skewness of the chi_squared distribution.
SELECT dist_chi_squared_skewness(5);
Output
| dist_chi_squared_skewness(5) |
|---|
| 1.2649110640673518 |
Related functions
- dist_chi_squared_sample() — Generates random samples from the chi_squared distribution with specified parameters
- dist_chi_squared_pdf() — Computes the probability density function (PDF) of the chi_squared distribution
- dist_chi_squared_cdf() — Computes the cumulative distribution function (CDF) of the chi_squared distribution
- dist_chi_squared_quantile() — Computes the quantile function (inverse CDF) 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_stddev() — Returns the standard deviation (σ) of the chi_squared distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
degrees_of_freedom
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the standard deviation (σ) of the chi_squared distribution.
SELECT dist_chi_squared_stddev(5);
Output
| dist_chi_squared_stddev(5) |
|---|
| 3.1622776601683795 |
Related functions
- dist_chi_squared_sample() — Generates random samples from the chi_squared distribution with specified parameters
- dist_chi_squared_pdf() — Computes the probability density function (PDF) of the chi_squared distribution
- dist_chi_squared_cdf() — Computes the cumulative distribution function (CDF) of the chi_squared distribution
- dist_chi_squared_quantile() — Computes the quantile function (inverse CDF) of the chi_squared distribution
- dist_chi_squared_mean() — Returns the mean (μ) of the chi_squared distribution, which is the first moment
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
degrees_of_freedom
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the support of the chi_squared distribution.
SELECT dist_chi_squared_support(5);
Output
| dist_chi_squared_support(5) |
|---|
| (0.0, 1.7976931348623157e+308) |
Related functions
- dist_chi_squared_sample() — Generates random samples from the chi_squared distribution with specified parameters
- dist_chi_squared_pdf() — Computes the probability density function (PDF) of the chi_squared distribution
- dist_chi_squared_cdf() — Computes the cumulative distribution function (CDF) of the chi_squared distribution
- dist_chi_squared_quantile() — Computes the quantile function (inverse CDF) 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_stddev() — Returns the standard deviation (σ) of the chi_squared distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
degrees_of_freedom
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the variance (σ²) of the chi_squared distribution.
SELECT dist_chi_squared_variance(5);
Output
| dist_chi_squared_variance(5) |
|---|
| 10.0 |
Related functions
- dist_chi_squared_sample() — Generates random samples from the chi_squared distribution with specified parameters
- dist_chi_squared_pdf() — Computes the probability density function (PDF) of the chi_squared distribution
- dist_chi_squared_cdf() — Computes the cumulative distribution function (CDF) of the chi_squared distribution
- dist_chi_squared_quantile() — Computes the quantile function (inverse CDF) 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_stddev() — Returns the standard deviation (σ) of the chi_squared distribution