Student's t functions in the Stochastic DuckDB extension
Function category
Student's t
24 functionsStudent's t — heavier-tailed alternative to Normal, parameterized by degrees of freedom. Small-sample inference.
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 Student's t distribution, P(X <= x).
SELECT dist_students_t_cdf(10.0, 1.5);
Output
| dist_students_t_cdf(10.0, 1.5) |
|---|
| 0.9177463367772799 |
Related functions
- dist_students_t_sample() — Generates a random sample from the Student's t distribution with the specified parameters
- dist_students_t_pdf() — Computes the probability density function (PDF) of the Student's t distribution at x
- dist_students_t_quantile() — Computes the quantile function (inverse CDF) of the Student's t distribution
- dist_students_t_mean() — Returns the mean of the Student's t distribution
- dist_students_t_stddev() — Returns the standard deviation of the Student's t 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 (survival function) of the Student's t distribution, P(X > x).
SELECT dist_students_t_cdf_complement(10.0, 1.5);
Output
| dist_students_t_cdf_complement(10.0, 1.5) |
|---|
| 0.08225366322272007 |
Related functions
- dist_students_t_sample() — Generates a random sample from the Student's t distribution with the specified parameters
- dist_students_t_pdf() — Computes the probability density function (PDF) of the Student's t distribution at x
- dist_students_t_cdf() — Computes the cumulative distribution function (CDF) of the Student's t distribution, P(X <= x)
- dist_students_t_quantile() — Computes the quantile function (inverse CDF) of the Student's t distribution
- dist_students_t_mean() — Returns the mean of the Student's t distribution
- dist_students_t_stddev() — Returns the standard deviation of the Student's t 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 Student's t distribution at x.
SELECT dist_students_t_chf(10.0, 1.5);
Output
| dist_students_t_chf(10.0, 1.5) |
|---|
| 2.497947352666178 |
Related functions
- dist_students_t_sample() — Generates a random sample from the Student's t distribution with the specified parameters
- dist_students_t_pdf() — Computes the probability density function (PDF) of the Student's t distribution at x
- dist_students_t_cdf() — Computes the cumulative distribution function (CDF) of the Student's t distribution, P(X <= x)
- dist_students_t_quantile() — Computes the quantile function (inverse CDF) of the Student's t distribution
- dist_students_t_mean() — Returns the mean of the Student's t distribution
- dist_students_t_stddev() — Returns the standard deviation of the Student's t distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
x
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Fits a standard Student's t distribution to x by maximum likelihood (golden section search). Returns a STRUCT with the fitted parameters (degrees_of_freedom) followed by the log_likelihood, aic and bic of the fit, or NULL when there are too few or only identical values. Returns NULL when the tails are no heavier than normal, where the degrees of freedom are unbounded. The whole sample is held in memory.
SELECT dist_students_t_fit(x) AS fit
FROM (VALUES (1.2), (0.7), (2.9), (1.8), (0.4), (3.6), (1.1), (2.2), (5.3), (0.9)) t(x);
Output
| fit |
|---|
| {'degrees_of_freedom': 1.413024185041085, 'log_likelihood': -25.52061409183976, 'aic': 53.04122818367952, 'bic': 53.343813276673565} |
Related functions
- dist_students_t_ks_test() — One-sample Kolmogorov-Smirnov test of whether x follows the Student's t distribution with the given parameters
- dist_students_t_pdf() — Computes the probability density function (PDF) of the Student's t distribution at x
- dist_students_t_cdf() — Computes the cumulative distribution function (CDF) of the Student's t distribution, P(X <= x)
- dist_students_t_sample() — Generates a random sample from the Student's t distribution with the specified parameters
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 Student's t distribution at x.
SELECT dist_students_t_hazard(10.0, 1.5);
Output
| dist_students_t_hazard(10.0, 1.5) |
|---|
| 1.5494117744276812 |
Related functions
- dist_students_t_sample() — Generates a random sample from the Student's t distribution with the specified parameters
- dist_students_t_pdf() — Computes the probability density function (PDF) of the Student's t distribution at x
- dist_students_t_cdf() — Computes the cumulative distribution function (CDF) of the Student's t distribution, P(X <= x)
- dist_students_t_quantile() — Computes the quantile function (inverse CDF) of the Student's t distribution
- dist_students_t_mean() — Returns the mean of the Student's t distribution
- dist_students_t_stddev() — Returns the standard deviation of the Student's t distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
x
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
degrees_of_freedom
|
Type
DOUBLE
|
Mode Positional | Description |
Description
One-sample Kolmogorov-Smirnov test of whether x follows the Student's t distribution with the given parameters. Returns the statistic D and the asymptotic p-value.
SELECT dist_students_t_ks_test(x, 10.0) AS ks
FROM (VALUES (1.2), (0.7), (2.9), (1.8), (0.4), (3.6), (1.1), (2.2), (5.3), (0.9)) t(x);
Output
| ks |
|---|
| {'statistic': 0.6512162951704386, 'p_value': 0.0004144716085637138} |
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
degrees_of_freedom
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the kurtosis of the Student's t distribution. Returns NULL when it is undefined for the given parameters.
SELECT dist_students_t_kurtosis(10.0);
Output
| dist_students_t_kurtosis(10.0) |
|---|
| 4.0 |
Related functions
- dist_students_t_sample() — Generates a random sample from the Student's t distribution with the specified parameters
- dist_students_t_pdf() — Computes the probability density function (PDF) of the Student's t distribution at x
- dist_students_t_cdf() — Computes the cumulative distribution function (CDF) of the Student's t distribution, P(X <= x)
- dist_students_t_quantile() — Computes the quantile function (inverse CDF) of the Student's t distribution
- dist_students_t_mean() — Returns the mean of the Student's t distribution
- dist_students_t_stddev() — Returns the standard deviation of the Student's t distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
degrees_of_freedom
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the excess kurtosis of the Student's t distribution. Returns NULL when it is undefined for the given parameters.
SELECT dist_students_t_kurtosis_excess(10.0);
Output
| dist_students_t_kurtosis_excess(10.0) |
|---|
| 1.0 |
Related functions
- dist_students_t_sample() — Generates a random sample from the Student's t distribution with the specified parameters
- dist_students_t_pdf() — Computes the probability density function (PDF) of the Student's t distribution at x
- dist_students_t_cdf() — Computes the cumulative distribution function (CDF) of the Student's t distribution, P(X <= x)
- dist_students_t_quantile() — Computes the quantile function (inverse CDF) of the Student's t distribution
- dist_students_t_mean() — Returns the mean of the Student's t distribution
- dist_students_t_stddev() — Returns the standard deviation of the Student's t 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 Student's t distribution.
SELECT dist_students_t_log_cdf(10.0, 1.5);
Output
| dist_students_t_log_cdf(10.0, 1.5) |
|---|
| -0.08583424813886927 |
Related functions
- dist_students_t_sample() — Generates a random sample from the Student's t distribution with the specified parameters
- dist_students_t_pdf() — Computes the probability density function (PDF) of the Student's t distribution at x
- dist_students_t_cdf() — Computes the cumulative distribution function (CDF) of the Student's t distribution, P(X <= x)
- dist_students_t_quantile() — Computes the quantile function (inverse CDF) of the Student's t distribution
- dist_students_t_mean() — Returns the mean of the Student's t distribution
- dist_students_t_stddev() — Returns the standard deviation of the Student's t 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 survival function of the Student's t distribution, log P(X > x).
SELECT dist_students_t_log_cdf_complement(10.0, 1.5);
Output
| dist_students_t_log_cdf_complement(10.0, 1.5) |
|---|
| -2.497947352666178 |
Related functions
- dist_students_t_sample() — Generates a random sample from the Student's t distribution with the specified parameters
- dist_students_t_pdf() — Computes the probability density function (PDF) of the Student's t distribution at x
- dist_students_t_cdf() — Computes the cumulative distribution function (CDF) of the Student's t distribution, P(X <= x)
- dist_students_t_quantile() — Computes the quantile function (inverse CDF) of the Student's t distribution
- dist_students_t_mean() — Returns the mean of the Student's t distribution
- dist_students_t_stddev() — Returns the standard deviation of the Student's t 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 (PDF) of the Student's t distribution at x. Useful for numerical stability when dealing with very small probabilities.
SELECT dist_students_t_log_pdf(10.0, 1.5);
Output
| dist_students_t_log_pdf(10.0, 1.5) |
|---|
| -2.0600719941327497 |
Related functions
- dist_students_t_sample() — Generates a random sample from the Student's t distribution with the specified parameters
- dist_students_t_pdf() — Computes the probability density function (PDF) of the Student's t distribution at x
- dist_students_t_cdf() — Computes the cumulative distribution function (CDF) of the Student's t distribution, P(X <= x)
- dist_students_t_quantile() — Computes the quantile function (inverse CDF) of the Student's t distribution
- dist_students_t_mean() — Returns the mean of the Student's t distribution
- dist_students_t_stddev() — Returns the standard deviation of the Student's t distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
degrees_of_freedom
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the mean of the Student's t distribution. Returns NULL when it is undefined for the given parameters.
SELECT dist_students_t_mean(10.0);
Output
| dist_students_t_mean(10.0) |
|---|
| 0.0 |
Related functions
- dist_students_t_sample() — Generates a random sample from the Student's t distribution with the specified parameters
- dist_students_t_pdf() — Computes the probability density function (PDF) of the Student's t distribution at x
- dist_students_t_cdf() — Computes the cumulative distribution function (CDF) of the Student's t distribution, P(X <= x)
- dist_students_t_quantile() — Computes the quantile function (inverse CDF) of the Student's t distribution
- dist_students_t_stddev() — Returns the standard deviation of the Student's t distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
degrees_of_freedom
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the median of the Student's t distribution. Returns NULL when it is undefined for the given parameters.
SELECT dist_students_t_median(10.0);
Output
| dist_students_t_median(10.0) |
|---|
| 0.0 |
Related functions
- dist_students_t_sample() — Generates a random sample from the Student's t distribution with the specified parameters
- dist_students_t_pdf() — Computes the probability density function (PDF) of the Student's t distribution at x
- dist_students_t_cdf() — Computes the cumulative distribution function (CDF) of the Student's t distribution, P(X <= x)
- dist_students_t_quantile() — Computes the quantile function (inverse CDF) of the Student's t distribution
- dist_students_t_mean() — Returns the mean of the Student's t distribution
- dist_students_t_stddev() — Returns the standard deviation of the Student's t 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 Student's t distribution. Returns NULL when it is undefined for the given parameters.
SELECT dist_students_t_mode(10.0);
Output
| dist_students_t_mode(10.0) |
|---|
| 0.0 |
Related functions
- dist_students_t_sample() — Generates a random sample from the Student's t distribution with the specified parameters
- dist_students_t_pdf() — Computes the probability density function (PDF) of the Student's t distribution at x
- dist_students_t_cdf() — Computes the cumulative distribution function (CDF) of the Student's t distribution, P(X <= x)
- dist_students_t_quantile() — Computes the quantile function (inverse CDF) of the Student's t distribution
- dist_students_t_mean() — Returns the mean of the Student's t distribution
- dist_students_t_stddev() — Returns the standard deviation of the Student's t 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 Student's t distribution at x.
SELECT dist_students_t_pdf(10.0, 1.5);
Output
| dist_students_t_pdf(10.0, 1.5) |
|---|
| 0.1274447942870916 |
Related functions
- dist_students_t_sample() — Generates a random sample from the Student's t distribution with the specified parameters
- dist_students_t_cdf() — Computes the cumulative distribution function (CDF) of the Student's t distribution, P(X <= x)
- dist_students_t_quantile() — Computes the quantile function (inverse CDF) of the Student's t distribution
- dist_students_t_mean() — Returns the mean of the Student's t distribution
- dist_students_t_stddev() — Returns the standard deviation of the Student's t 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 Student's t distribution. Returns the smallest x such that P(X <= x) >= p.
SELECT dist_students_t_quantile(10.0, 0.95);
Output
| dist_students_t_quantile(10.0, 0.95) |
|---|
| 1.812461122811676 |
Related functions
- dist_students_t_sample() — Generates a random sample from the Student's t distribution with the specified parameters
- dist_students_t_pdf() — Computes the probability density function (PDF) of the Student's t distribution at x
- dist_students_t_cdf() — Computes the cumulative distribution function (CDF) of the Student's t distribution, P(X <= x)
- dist_students_t_mean() — Returns the mean of the Student's t distribution
- dist_students_t_stddev() — Returns the standard deviation of the Student's t 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 Student's t distribution. Returns x such that P(X > x) = p, useful for upper tail quantiles.
SELECT dist_students_t_quantile_complement(10.0, 0.95);
Output
| dist_students_t_quantile_complement(10.0, 0.95) |
|---|
| -1.812461122811676 |
Related functions
- dist_students_t_sample() — Generates a random sample from the Student's t distribution with the specified parameters
- dist_students_t_pdf() — Computes the probability density function (PDF) of the Student's t distribution at x
- dist_students_t_cdf() — Computes the cumulative distribution function (CDF) of the Student's t distribution, P(X <= x)
- dist_students_t_quantile() — Computes the quantile function (inverse CDF) of the Student's t distribution
- dist_students_t_mean() — Returns the mean of the Student's t distribution
- dist_students_t_stddev() — Returns the standard deviation of the Student's t distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
degrees_of_freedom
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the range of the Student's t distribution as [min, max].
SELECT dist_students_t_range(10.0);
Output
| dist_students_t_range(10.0) |
|---|
| [-inf, inf] |
Related functions
- dist_students_t_sample() — Generates a random sample from the Student's t distribution with the specified parameters
- dist_students_t_pdf() — Computes the probability density function (PDF) of the Student's t distribution at x
- dist_students_t_cdf() — Computes the cumulative distribution function (CDF) of the Student's t distribution, P(X <= x)
- dist_students_t_quantile() — Computes the quantile function (inverse CDF) of the Student's t distribution
- dist_students_t_mean() — Returns the mean of the Student's t distribution
- dist_students_t_stddev() — Returns the standard deviation of the Student's t distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
degrees_of_freedom
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Generates a random sample from the Student's t distribution with the specified parameters.
SELECT dist_students_t_sample(10.0);
Output
| dist_students_t_sample(10.0) |
|---|
| -0.9323205265198327 |
Related functions
- dist_students_t_pdf() — Computes the probability density function (PDF) of the Student's t distribution at x
- dist_students_t_cdf() — Computes the cumulative distribution function (CDF) of the Student's t distribution, P(X <= x)
- dist_students_t_quantile() — Computes the quantile function (inverse CDF) of the Student's t distribution
- dist_students_t_mean() — Returns the mean of the Student's t distribution
- dist_students_t_stddev() — Returns the standard deviation of the Student's t distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
degrees_of_freedom
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
n
|
Type
BIGINT
|
Mode Positional | Description |
Description
Generates a list of n random samples from the Student's t distribution with the specified parameters.
SELECT dist_students_t_samples(10.0, 5);
Output
| dist_students_t_samples(10.0, 5) |
|---|
| [-0.8798797600881513, -2.749469885240554, -1.0929195979388697, 0.5531474278023365, 0.7793300155830558] |
Related functions
- dist_students_t_sample() — Generates a random sample from the Student's t distribution with the specified parameters
- dist_students_t_pdf() — Computes the probability density function (PDF) of the Student's t distribution at x
- dist_students_t_quantile() — Computes the quantile function (inverse CDF) of the Student's t distribution
- dist_students_t_mean() — Returns the mean of the Student's t distribution
- dist_students_t_stddev() — Returns the standard deviation of the Student's t distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
degrees_of_freedom
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the skewness of the Student's t distribution. Returns NULL when it is undefined for the given parameters.
SELECT dist_students_t_skewness(10.0);
Output
| dist_students_t_skewness(10.0) |
|---|
| 0.0 |
Related functions
- dist_students_t_sample() — Generates a random sample from the Student's t distribution with the specified parameters
- dist_students_t_pdf() — Computes the probability density function (PDF) of the Student's t distribution at x
- dist_students_t_cdf() — Computes the cumulative distribution function (CDF) of the Student's t distribution, P(X <= x)
- dist_students_t_quantile() — Computes the quantile function (inverse CDF) of the Student's t distribution
- dist_students_t_mean() — Returns the mean of the Student's t distribution
- dist_students_t_stddev() — Returns the standard deviation of the Student's t distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
degrees_of_freedom
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the standard deviation of the Student's t distribution. Returns NULL when it is undefined for the given parameters.
SELECT dist_students_t_stddev(10.0);
Output
| dist_students_t_stddev(10.0) |
|---|
| 1.118033988749895 |
Related functions
- dist_students_t_sample() — Generates a random sample from the Student's t distribution with the specified parameters
- dist_students_t_pdf() — Computes the probability density function (PDF) of the Student's t distribution at x
- dist_students_t_cdf() — Computes the cumulative distribution function (CDF) of the Student's t distribution, P(X <= x)
- dist_students_t_quantile() — Computes the quantile function (inverse CDF) of the Student's t distribution
- dist_students_t_mean() — Returns the mean of the Student's t distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
degrees_of_freedom
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the support of the Student's t distribution as [min, max].
SELECT dist_students_t_support(10.0);
Output
| dist_students_t_support(10.0) |
|---|
| [-inf, inf] |
Related functions
- dist_students_t_sample() — Generates a random sample from the Student's t distribution with the specified parameters
- dist_students_t_pdf() — Computes the probability density function (PDF) of the Student's t distribution at x
- dist_students_t_cdf() — Computes the cumulative distribution function (CDF) of the Student's t distribution, P(X <= x)
- dist_students_t_quantile() — Computes the quantile function (inverse CDF) of the Student's t distribution
- dist_students_t_mean() — Returns the mean of the Student's t distribution
- dist_students_t_stddev() — Returns the standard deviation of the Student's t distribution
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
degrees_of_freedom
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the variance of the Student's t distribution. Returns NULL when it is undefined for the given parameters.
SELECT dist_students_t_variance(1.5) AS undefined, round(dist_students_t_variance(5.0), 6) AS df_5;
Output
| undefined | df_5 |
|---|---|
| NULL | 1.666667 |
Related functions
- dist_students_t_sample() — Generates a random sample from the Student's t distribution with the specified parameters
- dist_students_t_pdf() — Computes the probability density function (PDF) of the Student's t distribution at x
- dist_students_t_cdf() — Computes the cumulative distribution function (CDF) of the Student's t distribution, P(X <= x)
- dist_students_t_quantile() — Computes the quantile function (inverse CDF) of the Student's t distribution
- dist_students_t_mean() — Returns the mean of the Student's t distribution
- dist_students_t_stddev() — Returns the standard deviation of the Student's t distribution