# NOT RUN {
#example
library(cpcens)
# The size of series(n) should be greater than 200.
sim=AR1.data(n = 500, N = 100, K = 5, eps = 1,
rho = 0.6, mu = 0, siga = 1, rates = c(NA, 0.2), Mrate = 0)
data=sim$data
N=100
agg = apply( data , 2 , sum )
pagg = PELT.ar( agg , 200*log(dim(data)[2]) )
agg.chpts = rep( rev( pagg$cpts )[1] , N )
# }
Run the code above in your browser using DataLab