WEIBULL
Updated 2024-03-13 14:33:37.143000
Syntax
SELECT [westclintech].[wct].[WEIBULL] (
<@X, float,>
,<@Alpha, float,>
,<@Beta, float,>
,<@Cumulative, bit,>)
Description
Use WEIBULL to calculate the Weibull distribution. The formula for the probability density function (pdf) is:
f(x;\lambda,k) = \begin{cases} \frac{k}{\lambda}\left(\frac{x}{\lambda}\right)^{k-1}e^{-(x/\lambda)^{k}}, & x\geq0 ,\\ 0, & x<0, \end{cases}
Where
{
"columns": [
{
"field": "column 1",
"maxWidth": 100
},
{
"field": "column 2",
"maxWidth": 325
}
],
"rows": [
{
"column 1": "x",
"column 2": "is the value at which to evaluate the function"
},
{
"column 1": "k",
"column 2": "us the shape parameter"
},
{
"column 1": "λ",
"column 2": "is the scale parameter"
}
]
}
The formula for the cumulative distribution function (cdf) is:
F(x;k,b) = 1 - e^{-bx^k}
Arguments
@Cumulative
is a logical value that determines if the probability density function (False, 0) or the cumulative distribution function (True, 1) is being calculated.
@X
is the value at which to evaluate the function. @X is an expression of type float or of a type that can be implicitly converted to float.
@Alpha
is the shape parameter of the distribution. @Alpha is an expression of type float or of a type that can be implicitly converted to float.
@Beta
is the scale parameter of the distribution. @Beta is an expression of type float or of a type that can be implicitly converted to float.
Return Type
float
Remarks
If @X < 0, WEIBULL returns an error.
If @Alpha = 0 or @Beta = 0, WEIBULL returns an error.
WEIBULL(@X,1,@Beta,@Cumulative)= EXPONDIST(@X,1/@Beta, @Cumulative).
Examples
select wct.WEIBULL(105, 20, 100, 'True');
This produces the following result.
{"columns":[{"field":"column 1","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"column 1":"0.929581390069277"}]}
select wct.WEIBULL(105, 20, 100, 'False');
This produces the following result.
{"columns":[{"field":"column 1","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"column 1":"0.0355888640245043"}]}
select wct.WEIBULL(6, 1, 10, 'False');
This produces the following result.
{"columns":[{"field":"column 1","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"column 1":"0.0548811636094027"}]}
select wct.EXPONDIST(6, 1.0000 / 10, 'False');
This produces the following result.
{"columns":[{"field":"column 1","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"column 1":"0.0548811636094026"}]}