Learn R Programming

nsRFA (version 0.3-0)

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 "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, ...)

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, 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.

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="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")

Run the code above in your browser using DataLab