lillietest
statistics: h = lillietest (x)
statistics: h = lillietest (x, name, value)
statistics: [h, p] = lillietest (…)
statistics: [h, p, kstat, critval] = lillietest (…)
Lilliefors goodness-of-fit hypothesis test.
h = lillietest (x) tests the null hypothesis that the
sample in the vector x comes from a normal distribution with unknown
mean and variance, against the alternative that it does not, using the
Lilliefors test. h is 1 if the test rejects the null at the 5%
significance level and 0 otherwise.
The Lilliefors statistic is the Kolmogorov-Smirnov statistic — the maximum absolute difference between the empirical cumulative distribution function of x and the cumulative distribution function of the hypothesized family with parameters estimated from x. Because the parameters are estimated, the null distribution of the statistic differs from that of the ordinary Kolmogorov-Smirnov test.
The following Name-Value pairs are supported:
| Name | Value |
|---|---|
'Distribution' | The hypothesized family:
'normal' (default), 'exponential', or
'extreme value'. The parameters are estimated from x: mean and
standard deviation for the normal, mean for the exponential, and location and
scale for the extreme value distribution. |
'Alpha' | The significance level, a scalar. Without
'MCTol' it must lie in (the tabulated range); with
'MCTol' it may be any value in . The default is
. |
'MCTol' | Maximum Monte-Carlo standard error for the p-value. When supplied, the p-value and critical value are computed by Monte-Carlo simulation instead of by interpolating the embedded table. |
Source Code: lillietest
[h, p, kstat, critval] = lillietest (…)
also returns the p-value p, the test statistic kstat, and the
critical value critval. Without 'MCTol' the p-value is clamped
to the tabulated range and a warning is issued when it
lies outside. The warning is an addition here: MATLAB clamps silently, so a
p-value reported as or there may be a bound rather
than an estimate, with nothing to say so.
See also: kstest, adtest, jbtest
Source Code: lillietest
Test whether a sample is normally distributed
x = [1 2 3 4 5 6 7 8 9 50]; # last value is an outlier [h, p, kstat] = lillietest (x)
warning: lillietest: P is less than the smallest tabulated value; returning 0.001.
warning: called from
lillietest>lillietest_interp_ at line 179 column 5
lillietest at line 139 column 6
__eval_demo__ at line 84 column 9
__demo_notebook__ at line 43 column 3
__build_demos__ at line 79 column 7
function_texi2html at line 135 column 5
package_texi2html at line 336 column 9
h = 1
p = 1.0000e-03
kstat = 0.4138