# GOFlaio2004: Goodness of fit tests In nsRFA: Non-Supervised Regional Frequency Analysis

## Description

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

## Usage

 ```1 2 3 4 5``` ``` A2_GOFlaio (x, dist="NORM") A2 (F) W2 (F) fw2 (w) ```

## 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 (that has to be sorted increasingly)
 `w` Transformed test statistic (Laio, 2004)

## 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 original paper of Laio (2004) is available on his web site.

## 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 non-exceedence probability P(A2). Note that P is the probability of obtaining the test statistic A2 lower than the one that was actually observed, assuming that the null hypothesis is true, i.e., P is one minus the p-value usually employed in statistical testing (see http://en.wikipedia.org/wiki/P-value). If P(A2) is, for example, greater than 0.90, the null hypothesis at significance level α=10\% is rejected.

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

`W2` is the Cramer-von Mises test statistic.

`fw2` is the approximation of the probability distribution of `w` (first 2 terms) when H_0 is true (Anderson-Darling, 1952); it is used by `A2_GOFlaio`.

## Note

For information on the package and the Author, and for all the references, see `nsRFA`.

`GOFmontecarlo`, `MLlaio2004`.

## Examples

 ```1 2 3 4 5 6 7 8 9``` ```sm <- rand.gumb(100, 0, 1) ml <- ML_estimation (sm, dist="GEV"); ml F.GEV(sm, ml[1], ml[2], ml[3]) A2(sort(F.GEV(sm, ml[1], ml[2], ml[3]))) A2_GOFlaio(sm, dist="GEV") ml <- ML_estimation (sm, dist="P3"); ml A2(sort(sort(F.gamma(sm, ml[1], ml[2], ml[3])))) A2_GOFlaio(sm, dist="P3") ```

### Example output

```[1] -0.01106749  1.12194652  0.06008279
[1] 0.953181341 0.419064857 0.573344484 0.148500309 0.191555657 0.583539078
[7] 0.632259368 0.856695870 0.766903875 0.378036391 0.835934604 0.934325116
[13] 0.816159393 0.725388690 0.278813106 0.570492333 0.013094052 0.794940346
[19] 0.315690898 0.545550555 0.498253428 0.248072804 0.189854782 0.047427602
[25] 0.992776191 0.123692049 0.037592115 0.297374611 0.005089954 0.834608173
[31] 0.899682559 0.961698230 0.411263879 0.596010541 0.957063522 0.431143486
[37] 0.579787914 0.135185717 0.651553486 0.984911114 0.297842945 0.952777428
[43] 0.614266361 0.553222276 0.734124885 0.750763835 0.725553488 0.437106676
[49] 0.165252946 0.176025926 0.528777034 0.107525303 0.525292081 0.455429758
[55] 0.223473319 0.116801053 0.306204921 0.992672841 0.095015397 0.713533104
[61] 0.476381154 0.564122900 0.656896203 0.251114950 0.276104386 0.828394057
[67] 0.505583914 0.486361653 0.465081097 0.518575152 0.162753347 0.101294365
[73] 0.056461162 0.337912794 0.061604368 0.128672313 0.737106417 0.761012528
[79] 0.761319855 0.237511870 0.734371609 0.143738563 0.190801329 0.022025673
[85] 0.093058531 0.220180832 0.663621965 0.770289117 0.662106646 0.917090307
[91] 0.651142704 0.632523084 0.832070598 0.778958574 0.632874343 0.682238553
[97] 0.572759658 0.270600900 0.688265212 0.880067846
[1] 0.2826452
A2     p(A2)
0.2826452 0.4785941
[1] -2.8536838  0.5224579  6.5603765
[1] 0.2787078
A2     p(A2)
0.2787078 0.4583228
```

nsRFA documentation built on March 20, 2018, 1:02 a.m.