| GOFlaio2004 {nsRFA} | R Documentation |
Anderson-Darling goodness of fit tests for extreme-value distributions, from Laio (2004).
A2_GOFlaio (x, dist="NORM") A2 (F) W2 (F) Fx (x, T, dist="NORM")
x |
data sample |
dist |
distribution: normal "NORM", log-normal "LN", Gumbel "EV1", Frechet "EV2", Generalized Extreme Value "GEV", Pearson type III "GAM", log-Pearson type III "LP3" |
F |
cumulative distribution function |
T |
parameters (position, scale, shape, ...) |
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, 0.92, the sample shouldn't be considered extracted from the hypothetical parent distribution with significance level greater than 8
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.
Alberto Viglione, e-mail: alviglio@tiscali.it.
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.
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="GAM") Fx(sm, ML_estimation (sm, dist="GAM"), dist="GAM") A2(sort(Fx(sm, ML_estimation (sm, dist="GAM"), dist="GAM"))) A2_GOFlaio(sm, dist="GAM")