STUDENTST
Updated 2024-03-13 13:39:32.120000
Syntax
SELECT [westclintech].[wct].[STUDENTST] (
<@X, float,>
,<@Degrees_freedom, float,>
,<@Cumulative, bit,>)
Description
Use STUDENTST to calculate Student’s t -distribution. The formula is:
f(t) = \frac{ 1 }{\ \sqrt{\nu\ }\ {\mathrm B}\left( \frac{\ 1\ }{ 2 },\ \frac{\ \nu\ }{ 2 }\right)\ } \ \left(\ 1 + \frac{\ t^2\ }{ \nu }\ \right)^{-(\nu+1)/2}\
Where
{
"columns": [
{
"field": "column 1",
"maxWidth": 100
},
{
"field": "column 2",
"maxWidth": 325
}
],
"rows": [
{
"column 1": "t",
"column 2": "is a random variable"
},
{
"column 1": "ν",
"column 2": "is the degrees of freedom"
},
{
"column 1": "B",
"column 2": "is the Beta function"
}
]
}
Arguments
@Cumulative
identifies the distribution calculation as being either the cumulative distribution function or the probability density function. @Cumulative is an expression of type bit or of a type that can be implicitly converted to bit.
@X
is the value supplied to the distribution. @X is an expression of type float or of a type that can be implicitly converted to float.
@Degrees_freedom
is a number specifying the degrees of freedom. @Degrees_freedom is an expression of type float or of a type that can be implicitly converted to float.
Return Type
float
Remarks
If @Degrees_freedom < 1 the function returns an error.
If @X < 0 the function returns an error.
@Degrees_freedom is truncated to zero decimal places.
Specify the cumulative distribution function by entering 'True' or 1 in @Cumulative.
Specify the probability density function by entering 'False' or 0 in @Cumulative.
Examples
To calculate the probability density function (pdf)
SELECT wct.STUDENTST(1, 2, 'False');
This produces the following result.
{"columns":[{"field":"column 1","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"column 1":"0.192450089729875"}]}
This may also be entered as:
SELECT wct.STUDENTST(1, 2, 0);
To calculate the cumulative distribution function (cdf):
SELECT wct.STUDENTST(1, 2, 'True');
This produces the following result.
{"columns":[{"field":"column 1","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"column 1":"0.788675134594813"}]}
This may also be entered as
SELECT wct.STUDENTST(1, 2, 1);