# cpBlockMax: Nonparametric Tests for Change-Point Detection in the... In npcp: Some Nonparametric CUSUM Tests for Change-Point Detection in Possibly Multivariate Observations

 cpBlockMax R Documentation

## Nonparametric Tests for Change-Point Detection in the Distribution of Independent Block Maxima

### Description

Nonparametric tests for change-point detection in the distribution of independent block maxima based either on the probability weighted moment method (see the second reference) or on the generalized probability weighted moment method (see the first reference) for estimating the parameters of the generalized extreme value (GEV) distribution. It is assumed that the block maxima are independent and that their unknown distribution functions (d.f.s) are continuous, but not necessarily that they are GEV distributed. Three statistics are computed. Under the assumption that the block maxima are GEV distributed, these are statistics particularly sensitive to changes in the location, scale and shape parameters of the GEV. Details can be found in third reference.

### Usage

```cpBlockMax(x, method = c("pwm", "gpwm"), r = 10)
```

### Arguments

 `x` a numeric vector representing independent block maxima whose unknown d.f.s are assumed continuous. `method` a string specifying how statistics will be defined; can be either `"pwm"` (the probability weighted moment method) or `"gpwm"` (the generalized probability weighted moment method). The method `"pwm"` is suggested for climate block maxima that are typically not too heavy tailed, more precisely, whose distributions are in the maximum domains of attraction of GEV distributions with shape parameters smaller than a half. The method `"gpwm"` should be preferred otherwise. `r` strictly positive integer specifying the set of breakpoints that will be tested; more precisely, starting from the initial sample of block maxima, the tests compare subsamples formed by the `k` first maxima and `n-k` last maxima for `k` in the set `{r,...,n-r}`, where `n` is the sample size.

### Details

Approximate p-values are computed from the estimated asymptotic null distributions, which involve the Kolmogorov distribution. The latter is dealt with reusing code from the `ks.test()` function; credit to RCore.

### Value

An object of `class` `htest` which is a list, some of the components of which are

 `statistic` value of the three test statistics. `pvalues` corresponding approximate p-values. `stats.loc` the values of the `n - (2 * r - 1)` intermediate change-point statistics sensitive to changes in the location; the first test statistic is defined as the maximum of those. `stats.scale` the values of the `n - (2 * r - 1)` intermediate change-point statistics sensitive to changes in the scale; the second test statistic is defined as the maximum of those. `stats.shape` the values of the `n - (2 * r - 1)` intermediate change-point statistics sensitive to changes in the shape; the third test statistic is defined as the maximum of those.

### Note

The tests were derived under the assumption of block maxima with continuous d.f., which implies that ties occur with probability zero. A way to deal with ties based on randomization is proposed in the third reference.

### References

J. Diebolt, A. Guillou, P. Naveau and P. Ribereau (2008), Improving probability-weighted moment methods for the generalized extreme-value distribution, REVSTAT 6, pages 33-50.

J.R.M. Hosking, J.R. Wallis and E.F. Wood (1985), Estimation of the generalized extreme-value distribution by the method of probability-weighted moments, Technometrics 27, pages 251-261.

I. Kojadinovic and P. Naveau (2017), Nonparametric tests for change-point detection in the distribution of block maxima based on probability weighted moments, Extremes 20:2, pages 417-450, https://arxiv.org/abs/1507.06121.

`cpDist()` for a related test based on the empirical d.f.

### Examples

```## Not run:
require(evd)
n <- 100
k <- 50 ## the true change-point

## Change in the shape parameter of a GEV
x <- rgev(k,loc=0,scale=1,shape=-0.8)
y <- rgev(k,loc=0,scale=1,shape=0.4)
cp <- cpBlockMax(c(x,y))
cp
## Estimated change-point
which(cp\$stats.shape == max(cp\$stats.shape))

## Change in the scale parameter of a GEV
x <- rgev(k,loc=0,scale=0.5,shape=0)
y <- rgev(k,loc=0,scale=1,shape=0)
cp <- cpBlockMax(c(x,y))
cp
## Estimated change-point
which(cp\$stats.scale == max(cp\$stats.scale))

## Change in the location parameter of a GEV
x <- rgev(k,loc=0,scale=1,shape=0)
y <- rgev(k,loc=0.5,scale=1,shape=0)
cp <- cpBlockMax(c(x,y))
cp
## Estimated change-point
which(cp\$stats.loc == max(cp\$stats.loc))
## End(Not run)
```

npcp documentation built on Feb. 16, 2023, 6:04 p.m.