# Example of a change in variance at 100 in simulated normal data
set.seed(1)
x=c(rnorm(100,0,1),rnorm(100,0,10))
single.var.css.calc(x,extrainf=FALSE) # finds change at 105
single.var.css.calc(x) # finds change at 105 and gives test statistic as 4.979771
# Example of no change in variance in simulated normal data
set.seed(1)
x=rnorm(100,0,1)
single.var.css.calc(x,extrainf=FALSE) # finds change at 53, this is the most probable point of
#change but if a changepoint test is performed then no change will be found.
single.var.css.calc(x)# change at 53, test statistic is 0.6922931
Run the code above in your browser using DataLab