Testes Normalidade
Testes Normalidade
Testes Normalidade
Duas medidas importantes para caracterizar uma distribuição não-normal são os coeficientesde skewness e de
kurtosis.
- No caso do skewness, coeficiente próximo de zero significa simetria, caso contrário, uma tendência à
esquerda para números negativos e, à direita para números positivos.
-A kurtosis mede a concentração próxima a média (ou pico),a Kurtosis (Curtose) é uma medida de dispersão
que caracteriza o "achatamento" da curva da função de distribuição.
Se o valor da Kurtosis for = 0, então tem o mesmo achatamento que a distribuição normal.
Se o valor é > 0 então a distribuição em questão é mais alta (afunilada) e concentrada que a distribuição
normal.
Se o valor é < 0 então a função de distribuição é mais "achatada" que a distribuição normal
The Shapiro-Wilk test, proposed in 1965, calculates a W statistic that tests whether a random sample, x1, x2, ...,
xn comes from (specifically) a normal distribution . Small values of W are evidence of departure from normality
and percentage points for the W statistic, obtained via Monte Carlo simulations, were reproduced by Pearson
and Hartley (1972, Table 16). This test has done very well in comparison studies with other goodness of fit
tests.
where the x(i) are the ordered sample values (x(1) is the smallest) and the ai are constants generated from the
means, variances and covariances of the order statistics of a sample of size n from a normal distribution (see
Pearson and Hartley (1972, Table 15).
For more information about the Shapiro-Wilk test the reader is referred to the original Shapiro and Wilk (1965)
paper and the tables in Pearson and Hartley (1972),
Additional discussion of the chi-square goodness-of-fit test is contained in the product and process
comparisons chapter (chapter 7).
Definition The chi-square test is defined for the hypothesis:
H0: The data follow a specified distribution.
Ha: The data do not follow the specified distribution.
Jarque–Bera
Test Statistic: test
For the chi-square goodness-of-fit computation, the data are divided into k bins and
In statistics, the
theJarque–Bera test
test statistic is is a goodness-of-fit
defined as measure of departure from
normality, based on the sample kurtosis and skewness. The test is named after Carlos
Jarque and Anil K. Bera. The test statistic JB is defined as
where is the observed frequency for bin i and is the expected frequency for bin
i. The expected frequency is calculated by
where n is the number of observations (or degrees of freedom in general); S is the sample
skewness, and K is the sample kurtosis:
where F is the cumulative Distribution function for the distribution being tested, Yu is
the upper limit for class i, Yl is the lower limit for class i, and N is the sample size.
This test is sensitive to the choice of bins. There is no optimal choice for the bin
width (since the optimal bin width depends on the distribution). Most reasonable
choices should produce similar, but not identical, results. Dataplot uses 0.3*s, where
s is the sample standard deviation, for the class width. The lower and upper bins are
at the sample mean plus and minus 6.0*s, respectively. For the chi-square
approximation to be valid, the expected frequency should be at least 5. This test is
not valid for small samples, and if some of the counts are less than five, you may
where and need aretothe estimates
combine some of bins
third in
and
thefourth
tails. central moments, respectively, is
the sample
Significance mean,. and is the estimate of the second central moment, the variance.
Level:
The statistic JBThe
Critical hastestan statistic
asymptotic chi-square
follows, distribution
approximately, with two degrees
a chi-square of freedom
distribution with (k and
- c) degrees
can be used tooftest
Region: the nullwhere
freedom hypothesis
k is thethat the data
number are from acells
of non-empty normalanddistribution.
c = the numberThe null
of
hypothesis is aestimated
joint hypothesis of the(including
parameters skewnesslocation
being zeroand and the
scale excess kurtosis
parameters being
and shape
0, since samples from a normal
parameters) distribution
for the distributionhave
+ 1.an expected
For example, skewness of 0 and an
for a 3-parameter Weibull
expected excess kurtosis of
distribution, c = 4.0 (which is the same as a kurtosis of 3). As the definition of JB
shows, any deviation from this increases the JB statistic.
Therefore, the hypothesis that the data are from a population with the specified
The chi-squaredistribution
approximation, however,
is rejected if is overly sensitive (lacking specificity) for small
samples, rejecting the null hypothesis often when it is in fact true. Furthermore, the
distribution of p-values departs from a uniform distribution and becomes a right-skewed uni-
modal distribution, especially for small p-values. This leads to a large Type I error rate. The
table below shows some p-values approximated by a chi-square distribution
with k -that differ from
where is the chi-square percent point function c degrees of freedom
their true alphaandlevels for very small samples.
a significance level of .
Calculated
In thep-value equivalents
above formulas for to
thetrue alpha
critical levels the
regions, at given sample
Handbook sizes the convention
follows
True α level 20 30 50 70 100
that.1 is the upper
.307critical.252
value from the chi-square
.201 .183 distribution
.1560 and is the
lower critical value from the chi-square distribution. Note that this is the opposite of
.05 .1461 .109 .079 .067 .062
what is used in some texts and software programs. In particular, Dataplot uses the
.025 convention.
opposite .051 .0303 .020 .016 .0168
.01 .0064 .0033 .0015 .0012 .002
(These values have been approximated by using Monte Carlo simulation on Matlab)
Purpose: As seen in MATLAB, the chi-square approximation for the JB statistic's distribution is only
Test for used for large sample sizes (> 2000). For smaller sample sizes, it uses a table derived from
Monte Carlo simulations in order to interpolate p-values for smaller samples. [1]
where n(i) is the number of points less than Yi and the Yi are ordered from smallest to largest value. This is a step
function that increases by 1/N at the value of each ordered data point.
The graph below is a plot of the empirical distribution function with a normal cumulative distribution function for 100
normal random numbers. The K-S test is based on the maximum distance between these two curves.
Due to limitations 2 and 3 above, many analysts prefer to use the Anderson-Darling goodness-of-fit test. However, the
Anderson-Darling test is only available for a few specific distributions.
Definition
The Kolmogorov-Smirnov test is defined by:
H0: The data follow a specified distribution
Ha: The data do not follow the specified distribution
Test The Kolmogorov-Smirnov test statistic is defined as
Statistic:
Technical Note
Previous editions of e-Handbook gave the following formula for the computation of the Kolmogorov-Smirnov goodness
of fit statistic:
This formula is in fact not correct. Note that this formula can be rewritten as:
This form makes it clear that an upper bound on the difference between these two formulas is i/N. For actual data, the
difference is likely to be less than the upper bound.
For example, for N = 20, the upper bound on the difference between these two formulas is 0.05 (for comparison, the
5% critical value is 0.294). For N = 100, the upper bound is 0.001. In practice, if you have moderate to large sample
sizes (say N ≥ 50), these formulas are essentially equivalent.
Anderson-Darling
Test
Purpose: The Anderson-Darling test (Stephens, 1974) is used to test if a sample of data
Test for came from a population with a specific distribution. It is a modification of the
Distributional Kolmogorov-Smirnov (K-S) test and gives more weight to the tails than does
Adequacy the K-S test. The K-S test is distribution free in the sense that the critical values
do not depend on the specific distribution being tested. The Anderson-Darling
test makes use of the specific distribution in calculating critical values. This has
the advantage of allowing a more sensitive test and the disadvantage that
critical values must be calculated for each distribution. Currently, tables of
critical values are available for the normal, lognormal, exponential, Weibull,
extreme value type I, and logistic distributions. We do not provide the tables of
critical values in this Handbook (see Stephens 1974, 1976, 1977, and 1979)
since this test is usually applied with a statistical software program that will
print the relevant critical values.
Lilliefors