There is a new R package, changepoint.np
which detects changes in the empirical distribution function. A minimal working example (demonstrated using a Normal distribution but it is a nonparametric test) is:
set.seed(1)
x=c(rnorm(100),rnorm(100,2))
out=cpt.np(x) # runs the ecdf changepoint method
plot(out) # plots the data with changepoints marked
cpts(out) # lists the changepoints identified
Alternatively, if you want a change in mean and are willing to make distributional assumptions the changepoint
package contains the cpt.mean
function or cpt.meanvar
if the variance is changing too.
If you have dependence in the data then you just need to inflate the default penalty otherwise you get spurious changes that are just due to the dependence structure. For that you might want to use the CROPS
(changepoints for a range of penalties) options available in both packages.