segneigh.var.norm(data, Q=5, pen=0, know.mean=FALSE, mu=-1000)
Segment Neighbourhoods: Auger, I. E. And Lawrence, C. E. (1989) Algorithms for the Optimal Identification of Segment Neighborhoods, Bulletin of Mathematical Biology 51(1), 39--54
segneigh.mean.norm
,segneigh.meanvar.norm
,cpt.var
,PELT.var.norm
,multiple.var.norm
,single.var.norm
,binseg.var.norm
# Example of multiple changes in variance at 50,100,150 in simulated normal data
set.seed(1)
x=c(rnorm(50,0,1),rnorm(50,0,10),rnorm(50,0,5),rnorm(50,0,1))
segneigh.var.norm(x,Q=5, pen=2*log(200)) # returns optimal number as 3 and the locations as c(50,99,150)
segneigh.var.norm(x,Q=3, pen=2*log(200)) # returns optimal number as 2 as this is the maximum number of changepoints it can find. If you get the maximum number, you need to increase Q until this is not the case.
# Example no change in variance
set.seed(10)
x=rnorm(200,0,1)
segneigh.var.norm(x,Q=5, pen=2*log(200)) # returns optimal number as 0
Run the code above in your browser using DataLab