Learn R Programming

nsRFA (version 0.5-8)

GOFlaio2004: Goodness of fit tests

Description

Anderson-Darling goodness of fit tests for extreme-value distributions, from Laio (2004).

Usage

A2_GOFlaio (x, dist="NORM")
 A2 (F)
 W2 (F)
 Fx (x, T, dist="NORM")

Arguments

x
data sample
dist
distribution: normal "NORM", log-normal "LN", Gumbel "GUMBEL", Frechet "EV2", Generalized Extreme Value "GEV", Pearson type III "P3", log-Pearson type III "LP3"
F
cumulative distribution function
T
parameters (position, scale, shape, ...)

Value

  • A2_GOFlaio tests the goodness of fit of a distribution with the sample x; it return the value $A_2$ of the Anderson-Darling statistics and its probability $P(A_2)$. If $P(A_2)$ is, for example, greater than 0.90, the test is not passed at level $\alpha=10%$.

    A2 is the Anderson-Darling test statistic; it is used by A2_GOFlaio.

    W2 is the Cramer-von Mises test statistic. Fx gives the empirical distribution function F of a sample x, extracted from the distribution dist with parameters T.

Details

An introduction on the Anderson-Darling test is available on http://en.wikipedia.org/wiki/Anderson-Darling_test and in the GOFmontecarlo help page. The oroginal paper of Laio (2004) is available on his web site.

References

Laio, F., Cramer-von Mises and Anderson-Darling goodness of fit tests for extreme value distributions with unknown parameters, Water Resour. Res., 40, W09308, doi:10.1029/2004WR003204.

See Also

GOFmontecarlo, MLlaio2004.

Examples

Run this code
sm <- sample_generator(100, c(0,1), dist="EV1")
ML_estimation (sm, dist="GEV")
Fx (sm, ML_estimation (sm, dist="GEV"), dist="GEV")
A2(sort(Fx(sm, ML_estimation (sm, dist="GEV"), dist="GEV")))
A2_GOFlaio(sm, dist="GEV")

ML_estimation (sm, dist="P3")
Fx(sm, ML_estimation (sm, dist="P3"), dist="P3")
A2(sort(Fx(sm, ML_estimation (sm, dist="P3"), dist="P3")))
A2_GOFlaio(sm, dist="P3")

Run the code above in your browser using DataLab