# Change point analysis

Could someone please explain change point to me. I'm using the package in R, and I don't really understand what the different methods mean, the pros and cons of each, and I especially do not understand the penalty value. When you increase the penalty value, what does that mean and what does it do? I have done a good amount of research online but I just keep finding the cran R and quick R sites, which are good, but the way they say it just isn't cutting it for me.

Thanks so much.

There are 3 main functions in the changepoint package, cpt.mean, cpt.var and cpt.meanvar. As a practitioner these are the only functions in the package that you should need. If you think that your data may contain a change in mean then you use the cpt.mean function, etc.

The next question you should ask yourself if whether you are looking for a single or multiple changes within your data. The method argument handles this, there is AMOC for At Most One Change, and PELT, BinSeg and SegNeigh for multiple changes. Which multiple changepoint method you want to use depends on:

a) Your choice of distribution / distribution-free method (see below) and

b) How much time you have / how accurate you want your answer to be. The BinSeg is quick but approximate, PELT is exact and quick but cannot be used in all distributions, SegNeigh is exact but slow.

The next question is what assumptions you can / are willing to make about your data. The key here is that the assumption applies to each set of data between changes and not for the entire data. For example, you may be able to assume a Normal distribution but if you do a test for Normality on the entire data it will most likely fail (due to the potential changes). Thus typically we make an assumption, run the changepoint analysis then check the assumptions based on the changes identified. Again, depending on the type of change there are different distribution and distribution-free methods. See the documentation for each function for the choices and feel free to comment which test statistic you are thinking of using and I can list the assumptions.

Finally, you look at the penalty. The penalty provides a compromise between lots of small changes and no changes. Thus if you set the penalty to 0 then you get a change at every possible location and if you set the penalty to infinity then you get no changes. The appropriate value of the penalty depends on your data and the question you want to answer. For example, you might have changes in mean of 0.5 units but you might only be interested in changes of 1+ units. There are many ways to choose your penalty:

1. "by-eye", i.e. try a few different values until you find one that looks appropriate for your problem.

2. "elbow-plot", i.e. plot the number of changepoints identified against the penalty used. This creates a curve whereby small values of the penalty produces large (spurious) changes and as the penalty decreases these spurious changes drop off at a fast rate, this rate slows as only true changes are left before slowly dropping down to no changes for larger penalties. The idea is to fit 2 straight lines to this curve and choose the penalty where they cross. This produces an ad-hoc but more objective way to choose the penalty than 1.

3. use an information criterion. There are some such as AIC, BIC/SIC, Hannan-Quinn included in the package. There are others that are not included in the package but you can provide a formula for pen.value if you wish.

If you need any more information or clarification on specific points, just comment and i'll try to answer.

• That is very helpful, thank you. My one thing is, I'm really strung up on the penalty value. What does it mean? When manually plugging in, how do you interpret a pen.value=.05 verse a pen.value=.40? What is that saying about your data? May 23, 2013 at 17:17
• The size of pen.value is relative to the data you are working on so you cannot really compare a pen.value of 0.05 on one data set with a pen.value of 0.4 on another. However, on the same data set the smaller penalty will identify more changes and thus be able to identify smaller changes in parameters. The larger penalty value is looking for larger changes before it considers them "significant". May 24, 2013 at 15:23
• So how do I know how significant is significant? If I put in pen.value=.20 I get 8 changepoints, but if I put in pen.value=.30, I only get 5 changepoints. How do I know if those 3 changepoints are signficant? How should I know which value to stick with? May 24, 2013 at 15:54
• see answer to Deb's new question at: stats.stackexchange.com/questions/60245/… May 30, 2013 at 15:42
• how does one go about perform rolling changepoint analysis? is that possible? Oct 11, 2014 at 2:37