# Example of multiple changes in mean and variance at 50,100,150 in simulated Exponential data
set.seed(1)
x=c(rexp(50,rate=1),rexp(50,rate=3),rexp(50,rate=1),rexp(50,rate=10))
PELT.meanvar.exp(x,pen=2*log(200)) # returns c(53,100,150,200)
# Example no change in rate parameter
set.seed(1)
x=rexp(200,rate=1)
PELT.meanvar.exp(x,pen=2*log(200)) # returns 200 to show no change in mean or variance has been
#found
Run the code above in your browser using DataLab