Double ShapiroWilks(TVec Data, ref THypothesisResult hRes, ref Double Signif, THypothesisType hType, Double Alpha)
The Shapiro-Wilks test for normality of data.
| # | Name | Description |
|---|---|---|
| 1 | Data | Data vector, containing ordered and unique deviates from unknown distribution. Data Length must be betweeen 3 and 5000, otherwise an execption is raised. |
| 2 | hRes | Returns the result of the null hypothesis (default assumption is that data comes from normal distribution). |
| 3 | hType | Defines the type of the null hypothesis (left, right and two - tailed). |
| 4 | Signif | (Significance level) returns the probability of observing the given result by chance given that the null hypothesis is true. |
| 5 | Alpha | Defines the desired significance level. If the significance probability (Signif) is bellow the desired significance (Alpha), the null hypothesis is rejected. |
Returns: Double - the Shapiro-Wilks statistics.
Remarks:
Performs the The Shapiro-Wilks test for normality of data.
Note
Basic assumption is Data values i.e. deviates from unknown distribution are ordered and unique.
Examples
using Dew.Math;
using Dew.Stats;
using Dew.Stats.Units;
namespace Dew.Examples
{
private void Example()
{
Vector a = new Vector(0);
Vector b = new Vector(0);
a.Size(1000, false);
StatRandom.RandomWeibull(2.5, 1.0, a, -1);
// filter original data, retain only sorted unique values
Statistics.Unique(a, b, null);
THypothesisResult hres;
double sign;
Statistics.ShapiroWilks(b, out hres, out sign, THypothesisType.htTwoTailed, 0.05);
// Significance approx. 0
// hres = hrReject -> data is not coming from normal distribution
}
}
See Also: Statistics.Unique, Statistics.ShapiroFrancia