rkillick / changepoint

A place for the development version of the changepoint package on CRAN.
127 stars 33 forks source link

Value for each segments #40

Closed xysj1989 closed 4 years ago

xysj1989 commented 4 years ago

Dear developer,

Thank you for this useful package!

I have already use cpt.meanvar to process my data. By the code:

pelt <- cpt.meanvar(mydata$height, test.stat = "Poisson", method = "BinSeg")

by the following code, I get the potential change points : [1] 2141 2518 3180

cpts(dis.pelt)

I have two questions: (1) how can I get the represented value for each following segment?:

0-2140 2142 - 2517 2519 - 3179 3181 - 5000

(2) how can I put these value of the plot? Maybe some parameter in plot(pelt) ?

Best

rkillick commented 4 years ago

Thanks for reaching out with your question on the package.

1) If you want the parameters fitted to each segment then you can access these using: param.est(pelt)

2) By default the plot function for cpt.meanvar will add the mean lines to the original signal. You can change the width of these lines using cpt.width and colour using cpt.col options to the plot function. plot(pelt,cpt.width=3,col='blue')

You may find the Journal of Statistical Software paper helpful in describing the features of the package. It is available as open access from here: https://www.jstatsoft.org/article/view/v058i03

If you have any further questions, please just ask.