# 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 <- cpTestBM(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 <- cpTestBM(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 <- cpTestBM(c(x,y))
cp
## estimated change-point
which(cp$stats.loc == max(cp$stats.loc))
# }
Run the code above in your browser using DataLab