Statistics::ShapiroFrancia Function

double ShapiroFrancia(TVec *Data, THypothesisResult &hRes, double &Signif, THypothesisType hType = THypothesisType::htTwoTailed, double Alpha = 0.05);

The Shapiro-Francia test for normality of data.

#NameTypeDescription
1DataTVec *Data vector, containing ordered and unique deviates from unknown distribution.
2hResTHypothesisResult &Returns the result of the null hypothesis (default assumption is that data comes from normal distribution).
3Signifdouble &(Significance level) returns the probability of observing the given result by chance given that the null hypothesis is true.
4hType = THypothesisType::htTwoTailedTHypothesisTypeDefines the type of the null hypothesis (left, right and two - tailed).
5Alpha = 0.05doubleDefines the desired significance level. If the significance probability (Signif) is bellow the desired significance (Alpha), the null hypothesis is rejected.

Returns: the Shapiro-Francia statistics.

Remarks:

Performs the The Shapiro-Francia test for normality of data.

Note
Basic assumption is Data values i.e. deviates from unknown distribution are ordered and unique.

Examples
#include "MtxExpr.h"
#include "Statistics.h"
#include "Units.StatRandom.h"
#include "Units.Statistics.h"

using namespace Dew;
using namespace Dew::Math;
using namespace Dew::Stats;
using namespace Dew::Stats::Units::StatRandom;
using namespace Dew::Stats::Units::Statistics;

void Example()
{
    Vector a(0);
    Vector b(0);
    a.Size(1000,false);
    RandomWeibull(2.5,1.0,a,-1);
    // filter original data, retain only sorted unique values
    Unique(a,b, nullptr);
    THypothesisResult hres;
    double sign;
    ShapiroFrancia(b,hres, sign,THypothesisType::htTwoTailed,0.05);
    // Significance approx. 0
    // hres = hrReject -> data is not coming from normal distribution
}
See Also: Statistics::Unique, Statistics::ShapiroWilks
Declared in Dew::Stats::Units::Statistics · Dew.Stats/Units.Statistics.h · Cross-compiler