binseg.var.css(data, Q=5, pen=0)
C. Inclan, G. C. Tiao (1994) Use of Cumulative Sums of Squares for Retrospective Detection of Changes of Variance, Journal of the American Statistical Association 89(427), 913--923
R. L. Brown, J. Durbin, J. M. Evans (1975) Techniques for Testing the Constancy of Regression Relationships over Time, Journal of the Royal Statistical Society B 32(2), 149--192
binseg.var.norm
,cpt.var
,multiple.var.css
,single.var.css
,segneigh.var.css
# Example of multiple changes in variance at 50,100,150 in simulated normal data
set.seed(10)
x=c(rnorm(50,0,1),rnorm(50,0,10),rnorm(50,0,5),rnorm(50,0,1))
binseg.var.css(x,Q=5, pen=1.358) # returns optimal number as 4 and the locations as c(50,52,100,149)
binseg.var.css(x,Q=2, pen=1.358) # 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.
# 1.358 is the asymptotic value of the penalty for 95% confidence
# Example no change in variance
set.seed(1)
x=rnorm(200,0,1)
binseg.var.css(x,Q=5, pen=1.358) # returns optimal number as 0
Run the code above in your browser using DataLab