Chang point model

Authors
Affiliation

Ellen L. Hamaker

Methodology & Statistics Department, Utrecht University

Ria H. A. Hoekstra

Methodology & Statistics Department, Utrecht University

Published

2026-01-02

This article has not been peer-reviewed yet and may be subject to change.
Want to cite this article? See citation info.

This article is about change point models, which are also known as turning point models or structural break models. Such models are of interest when you have a process that is characterized by sudden changes in for instance the mean, trend, variance, and/or dynamics over time. A change point is thus located in time and partitions an ongoing process into distinct regimes or states, each characterized by its own statistical properties. The switch between such distinct phases in intensive longitudinal data may demarcate a transition between distinct contexts a case (e.g., a person or dyad) is in. For instance, changes in the mean and variability of a person’s affective well-being may change prior to, during, and after an intervention.

The change point models that are considered here fall within the broader class of regime-switching models. Typical of change point models compared to other regime-switching models is that there are only a few sudden changes, or even only one. The timing of these changes may be known beforehand, but may also be estimated based on the data. Research questions you may tackle with change point analysis concern whether such a change point exists, when it occurred, how many occurred, and what aspects of the process changed at a particular change point.

Below you can read more about: 1) what a change point model is; 2) the specification of a change point model; and 3) the differences between knowing versus not knowing the timing of a change point.

1 What is a change point model?

A change point model is characterized by a sudden change in one or more aspects of the series over time. The simplest version of this is a change in level (i.e., the mean), where there is an abrupt shift in the mean, distinguishing an episode before and after the change point. Other aspects that can change are the trend and/or the variability. You can read more about each of these below.

1.1 Change in level

Suppose you are interested in a process that is stable over time, meaning there is a constant mean with fleeting fluctuations around this. At some point in time, there is an event or intervention, which leads to a sudden change in the mean, while the pattern of fluctuations around this remains the same. This can be expressed as

\[ y_t = \begin{cases} b_{0(1)} + \epsilon_t, & \text{if } t < \tau \\[2mm] b_{0(2)} + \epsilon_t, & \text{if } t \ge \tau \end{cases} \]

where \(\tau\) represents the time of the change point, and the temporal residuals \(\epsilon_t\) come from a white noise distribution with a mean of zero and variance \(\sigma_{\epsilon}^2\). Hence, there are two regimes or phases here: the first one prior to the change point \(\tau\), which is characterized by a mean of \(b_{0(1)}\) (where the subscript (1) refers to the first regime), and the second one from the change point onward, which is characterized by a mean of \(b_{0(2)}\) (where the subscript (2) indicates this is a parameter associated with the second regime).

You can see an example of this in Figure 1, which shows that at the time of the change point \(\tau=29\), there is a sudden drop in mean, because \(b_{0(1)}>b_{0(2)}\).

Figure 1: Example of a change point model that is characterized by a sudden drop in mean.

Anouk is interested in the effect of Ritalin on the impulsivity of a child diagnosed with attention deficit hyperactivity disorder (ADHD). Anouk has obtained daily records of the impulsivity of the child for 28 days prior to starting medication, and for 32 days after medication was started.

Since the effect of Ritalin is known to wear off within a few hours, Anouk does not expect the effectiveness to build up over time. Instead, she expects to see a single, sudden drop in the level of impulsivity, such that the phase before and the phase after medication was started are characterized by a different mean. She therefore considers to use a simple change point model to analyze the daily measures she obtained.

In some literature, you will see this model presented with the indicator function \(I\). For instance, the model above can be also expressed as

\[ y_t = \{b_{0(1)} + \epsilon_t \}I(t < \tau) + \{b_{0(2)} + \epsilon_t \}I(t \geq \tau).\] The indicator function \(I(t < \tau)\) takes on value 1 if \(t\) is smaller than the change point value \(\tau\); if \(t\) is larger or equal to \(\tau\), this indicator function is 0. For the second indicator function, it is exactly the opposite, that is \(I(t \geq \tau)\) takes on value 1 when \(t\) is larger or equal to \(\tau\), and it takes on value 0 when \(t\) is smaller than \(\tau\). As a result, for any value of \(t\) one of the indicator functions will take on the value 1 while the other is 0; therefore, only one of the two regime expressions (i.e., either \(\{b_{0(1)} + \epsilon_t \}\) or \(\{b_{0(2)} + \epsilon_t \}\)) will be selected.

1.2 Change in slope

Instead of a change in the mean, there may also be a change in the slope. A simple example of this is a change point model that includes an intercept and linear slope for both phases, which can be expressed as

\[ y_t = \begin{cases} b_{0(1)} + b_{1(1)} t + \epsilon_t, & \text{if } t < \tau \\[2mm] b_{0(2)} + b_{1(2)} t + \epsilon_t, & \text{if } t \ge \tau \end{cases} \]

where the parameters \(b_{0(1)}\) and \(b_{1(1)}\) are the intercept and linear slope over time for the regime prior to the change point \(\tau\), whereas \(b_{0(2)}\) and \(b_{1(2)}\) represent the the intercepts and linear slope of time during the second regime from the change point onward.

In Figure 2 you see an example of this, where the phase prior to the change point is characterizes by stability (i.e., \(b_{1(1)} = 0\)), whereas the phase after the change point is characterized by a gradual decrease (i.e., \(b_{1(2)} < 0\)).

Figure 2: Example of a change point model that is characterized by a stable mean prior to the change point, and a linear decrease after the change point.

In addition to studying the effect of Ritalin on impulsivity, Anouk also wants to investigate whether impulsivity can be reduced with a behavior training. For this purpose she obtained daily records of impulsivity from a different child for 28 days prior to starting the training, and then for 32 days while the training was taking place.

In this case, Anouk expects the effectiveness to build up over time, as the child is become more aware of their behavior and learns how to stop themselves and take a moment to think before acting. Hence, Anouk considers to use a change point model to analyze the daily measures she obtained, in which there is no slope prior to the change point, and a negative slope after the change point. She does not expect a sudden change when the training starts, so most likely the two line segments are connected at the change point.

You can see another example of this model in Figure 3, where there is a steady decrease prior to the change point (i.e., \(b_{1(1)}<0\)), and a gradual increase after the change point (i.e., \(b_{1(2)}>0\)).

Figure 3: Example of a change point model that is characterized by a steady decrease prior to the change point, and an increase after the change point.

Anouk wonders whether the effect of a behavioral training remains after the training is over. Therefore, she obtains data regarding the daily impulsivity of a child during and after the behavioral training.

In this case, Anouk expects a decrease in impulsivity during the phase that the training is taking place. But once the training has stopped, there may be a gradual increase in impulsivity again. Hence, she will use a change point model again that includes an intercept and linear slope for each regime. But now she expects a negative slope in the first phase, and perhaps a positive slope in the second phase.

It is also possible that the change point is characterized by a sudden change as well as a change in the trend. You can see an example of this in Figure 4, where there is a stable process prior to the change point (i.e., \(b_{1(1)} = 0\)), and there is a sudden drop at the change point, followed by a further decrease (i.e., \(b_{1(2)} <0\)).

Figure 4: Example of a change point model that is characterized by both a sudden change and a change in the trend at the time of the change point.

When considering this latter example, you may be tempted to think that the sudden drop at the change point should imply that the intercepts \(b_{0(1)}\) and \(b_{0(2)}\) are different. Although the plotted time series suggests a sudden drop at the change point, it is important to note that the intercept does not describe the level at the change point itself, but the value the line would take at \(t=0\). This intuition is therefore misleading; in fact, the two regimes actually have the same intercept (i.e., \(b_{0(1)} = b_{0(2)}\)) here.

You can see this when you consider extrapolating the trend during the second phase (from the change point onward) backwards in time to see what value it takes on when \(t=0\). In this case, this extrapolated trend will intersect with the y-axis at the same value as the trend that characterizes the first phase. This shows that it can be challenging to determine whether or not there is a sudden drop or jump at the change point when there are also trends during (one or both of) the regimes. How you can investigate this when estimating the model, is discussed in the section below on estimation.

Anouk wonders whether the start of the behavioral training may be characterized by a sudden drop in impulsivity, perhaps due to the additional attention that the child is receiving now. So instead of having a trend that starts at the level that characterized the phase prior to the change point, there may be a sudden shift downward, followed by an additional gradual decrease in impulsivity over time.

In addition to the linear trend, you can also consider non-linear trends for the various phases, for instance quadratic or exponential functions of time. You can read more about the various shapes in the article about deterministic trends.

1.3 Change in variability

Another aspect that you may find interesting is the variability in your process and how this changes due to an event or intervention. In this case, you need to extend the model above with phase-specific residual variances \(\sigma_{(1)}^2\) and \(\sigma_{(2)}^2\). You can express this as

\[ y_t = \begin{cases} b_{0(1)} + b_{1(1)} t + \sigma_{(1)} \epsilon_t, & \text{if } t < \tau \\[2mm] b_{0(2)} + b_{1(2)} t + \sigma_{(2)} \epsilon_t, & \text{if } t \ge \tau \end{cases}. \]

where \(\epsilon_t\) is a white noise sequence with a variance of \(\sigma_{\epsilon}^2=1\). By pre-multiplying these residuals by the phase-specific standard deviation (i.e., either \(\sigma_{(1)}\) or \(\sigma_{(2)}\)), you get a residual term that actually has the phase-specific variances; that is, \(\sigma_{(1)} \epsilon_t\) will have variance \(\sigma_{(1)}^2\) and \(\sigma_{(2)} \epsilon_t\) will have variance \(\sigma_{(2)}^2\).

In Figure 5 you can see an example of this change point model, where the two phases are each characterized by stability (i.e., \(b_{1(1)}=0\) and \(b_{1(2)}=0\)), yet around a different mean (i.e., \(b_{0(1)}\neq b_{0(2)}\)) and with different variance (i.e., \(\sigma_{(1)}^2\neq \sigma_{(2)}^2\)). Prior to the change point the mean and variance are both higher than after the change point, meaning that \(b_{0(1)} > b_{0(2)}\) and \(\sigma_{(1)}^2 > \sigma_{(2)}^2\).

Figure 5: Example of a change point model that is characterized by a change in the mean and in the variability.

Anouk wonders whether the effect of Ritalin on impulsivity is actually two-fold, in that it reduces the average level of impulsivity, but also the variability in impulsivity. The latter would imply that a child’s impulsivity becomes more predictable, and varies less over the days. To allow for both changes, Anouk wants to consider a change point model that includes changes in the mean and in the variance.

Such changes in variability can also be combined with changes in the trend (i.e., \(b_{1(1)} \neq b_{1(2)}\) in the linear case). It is also possible that there is actually only a change in variability, while there is no trend (i.e., \(b_{1(1)} = b_{1(2)}=0\)) and there is no change in the mean (i.e., \(b_{0(1)} = b_{0(2)}\)).

2 Specifying change point models

To estimate a change point model, you have to specify it first. In this section you can read more about how to specify a change point model that allows for changes in the mean and/or slope across the various phases by using a specific set of predictor variables. Estimation is discussed in the following section.

2.1 Accounting for a sudden shift

To account for a a sudden shift at the change point, you can simply add a dummy variable to your regression model that consists of 0’s before the change point and from the change point onward of 1’s. You can see an example of a small dataset in Figure 6. It consists of only 8 occasions, and the change point is located at \(t=4\). The \(y\) variable is the outcome of interest.

Figure 6: Data setup to account for a sudden shift at the change point \(t=4\), while allowing for a linear trend before and after with the same slope.

Two predictors have been created. The first is simply time starting with 0 for the first occasion, that is \(x_1 = t-1\). This way, the intercept that will be estimated with the model will equal the expected value of the trend at the first measurement occasion (rather than one time point before the measurements started). The second predictor \(x_2\) is a dummy that signifies the second phase.

When you include these two predictors in a regression model, you get \(y_t = b_0 + b_1 x_{1t} + b_2 x_{2t} + \epsilon_t\). The meaning of the three \(b\) coefficients is visualized in Figure 7. As explained, \(b_0\) is the expected value (based on the trend) at occasion 1. The regression coefficient \(b_1\) represents the slope of the trend, and \(b_2\) represents the sudden shift at the change point.

Figure 7: Sudden shift \(b_2\) at change point \(t=4\).

2.2 Accounting for a change in slope

Instead of expecting a sudden shift at the change point, you may expect a change in slope. To accommodate this, you need to use a predictor variable that allows for a change in the linear slope from the the change point onward.

In Figure 8 you see an example of how this can be accomplished. Again, the change point is at occasion \(t=4\). From that point onward, the predictor variable \(x_3\) contains the values of a linear trend starting at 0.

Figure 8: Data setup to account for a sudden change in slope at the change point \(t=4\), thus allowing for a linear trend before and after with different slopes.

By including both \(x_1\) and \(x_3\) in your model, you allow for two distinct linear trends for the two phases, prior and after the change point. Specifically, you get \(y_t = b_0 + b_1 x_{1t} + b_3 x_{3t} + \epsilon_t\), where \(b_0\) and \(b_1\) are the intercept and slope for the first phase as before. The regression coefficient \(b_3\) represents the change in slope during the second phase in comparison to the first phase. This is illustrated in Figure 9.

Figure 9: Sudden change in slope \(b_3\) at change point \(t=4\).

The slope after the change point equals the sum of the slope during the first phase plus the change in the slope, that is, \(b_1 + b_3\). Here, both coefficients are positive, meaning there is an increase prior to the change point, and the increase is even steeper after the change point.

But other combinations are also possible, of course. For instance, if \(b_3<0\), this could imply one of the following three: a) the increase after the change point is less than that before the change point; b) the phase after the change point is characterized by stability (when \(b_1+b_3=0\)); or c) the slope after the change point has changed sign and there is actually a decrease during the second phase (when \(b_1+b_3<0\)).

2.3 Accounting for a sudden shift and a change in slope

The two changes presented above can also be combined. This implies that you may expect that there is both an abrupt increase or decrease at the change point, and that the slope changes. As a result, you will have two separate slopes for the two phases, which are disconnected at the change point. To achieve this, you should have all three predictor variables that were defined before (i.e., \(x_1\), \(x_2\) and \(x_3\)) in your data setup. This is shown in Figure 10.

Figure 10: Data setup to account for a sudden shift and a change in slope at the change point \(t=4\), thus allowing for a linear trend before and after with different slopes, which are disconnected at the change point.

If you include these three predictors in your regression model, this gives you \(y_t = b_0 + b_1 x_{1t} + b_2 x_{2t} + b_3 x_{3t} + \epsilon_t\), where the parameters \(b_0\), \(b_1\), \(b_2\) and \(b_3\) have the same interpretation as in the two models described above. This is also illustrated in Figure 11: It shows that with this model you can study whether there is a sudden shift at the change point (represented by \(b_1\)), and/or whether there is a change in slope at the change point (represented by \(b_3\)).

Figure 11: Sudden shift \(b_1\) and change in slope \(b_3\) at change point \(t=4\).

2.4 Alternative parametrization

Instead of the approach above, you may also consider using another parametrization. This is based on having separate intercepts and slopes in each phase, rather than estimating the changes at the change point. To achieve this, you should use a data setup as shown in Figure 12.

Figure 12: Alternative data setup to account for a sudden shift and a change in slope at the change point \(t=4\).

The difference with the data setup shown before in Figure 10 is that the predictor variable \(x_1\) now contains 0’s after the change point, whereas before it continued in a linear fashion. This may seem like a minor difference, but the consequences of this for the interpretation of \(b_3\) are quite substantial.

The interpretation of \(b_0\), \(b_1\), and \(b_2\) remain as before: These represent the intercept and slope during the first phase, prior to the change point, and the sudden shift at the change point. But in the current setup, \(b_3\) no longer represent the change in slope between the first and second phase; instead, it now represents the slope during the second phase. Hence, this parametrization allows you to investigate not whether there was a change in slope, but rather, whether there is an increasing or decreasing slope in the second phase.

In Figure 13 you can see how the parameters from the four specifications provided above can be linked to the regime-specific parameters from the change point model presented in the previous section.

Figure 13: Overvies of how the original change point model parameters (on the left) are represented by the coefficients from the various regression models, depending on their parametrization.

2.5 Further extensions

While above, only linear trends were considered, you can extend a change point model with other deterministic trends, thereby allowing for more flexibility before and after the change. Moreover, there can also be multiple change points over time.

3 Estimation when the change point is known or unknown

In the presentation above, it was assumed that the location of the change point is known: Based on the known timing of the change point, the predictor variables can be created that allow for a change in level and/or slope. However, you may not know the exact time at which the change took place. This introduces several additional challenges, both during estimation of the model parameters, but also in model comparisons. The latter is relevant if you want to determine whether a change took place, and if so, how many change points there were.

Peter is looking at the effect of an antidepressant on feelings of helplessness in a patient. He has obtained daily diary measurements prior to the start of treatment. After 4 weeks, the patient is given an antidepressant, and this is continued for the following 3 months; during this time Peter also obtained daily diary measurements.

Peter wants to investigate how much time it takes after initiating treatment with antidepressant before the patient starts to experience an improvement in their feelings of helplessness. He assumes this happens somewhere between 3 up to 5 weeks after the start of treatment. He considered using a change point model for this, in which he will freely estimate the location of the change point.

Additionally, Peter wonders whether during the 3 month treatment period that he observed, the full therapeutic effect is realized; this would imply that at some point the decline in feelings of helplessness levels off. To study this, Peter considers using a change point model with two unknown change points. After locating the change points, he will check whether the trends and changes are in line with his expectations. He also wants to compare the model with two change points to a model with only one change point.

When the timing of the change point is known, it is easy to investigate whether this really constitutes a change point. You can either consider the parameters that signify the change in mean, intercept and/or slope at that moment and determine whether these differ from zero, or you can fit a model with and one without the change point and compare their fit with for instance a log likelihood test or an information criterion.

But matters are more complex when you want to know whether there is a change point and you do not know when the change point took place. In this situation, you can find the best possible location for the change point by trying out any possible moment in time, and comparing the fit of the various models, for instance through least squares estimation: By performing an exhaustive search, you can find the location that is associated with the smallest residuals, and thus the best fit. This can be considered the best estimate for the timing of the change point \(\tau\).

But investigating whether a change point model is needed, and how many change points it should contain, is very challenging. The problem with not knowing when the change point occurred has been described as having nuisance parameters that are absent under the null hypothesis (Hamaker, 2009; Tong, 1993). To understand what this means, consider the model in which there is a change in mean between the phase before and after the change point, that is,

\[ y_t = \begin{cases} b_{0(1)} + \epsilon_t, & \text{if } t < \tau \\[2mm] b_{0(2)} + \epsilon_t, & \text{if } t \ge \tau \end{cases}. \]

You can think of the linear (no change point) model as a special case of this change point model in two ways. For instance, you can get the no-change model by setting the means of the two regimes to be equal to each other, that is: \(b_{0(1)} = b_{0(2)}\). However, this implies the parameter \(\tau\) could be situated anywhere in time, which makes the change point parameter undefined under the simpler model. Alternatively, you may state that the change point took place outside the range of observed time points (so prior to the observations started, or after they were completed); but in that case, you only have observations that allow you to estimate \(b_{0(1)}\) or \(b_{0(2)}\), and one of these is thus also unidentified.

Thus, while the model without the change point is nested under the model with a change point (and a model with one change point is nested under a model with two change points, etc.), you cannot use a simple loglikelhood test or information criterion to compare these, as such statistics were not developed for this kind of model comparison. Instead, you need to consider alternatives that have been particularly developed for change point models with unknown change point locations. For instance, Ninomiya (2005) derived an Akaike information criterion for change point models, showing that the penalty for a change point should be 6 rather than the regular 2 that is used for other model parameters. To truly understand why this is the case, you need to study Ninomiya’s derivation; but even without fully appreciating the reason why, what is important to realize is that there is a difference between comparing models with known change point locations versus models with unknown change point locations.

4 Think more about

The change point models discussed in this article, do not contain any short-term dynamics. If you want to combine sudden changes in mean, trend, and/or variability with dynamics as well, this can be achieved by making use of a Kalman filter approach, based on a state-pace formulation of the model. This approach allows you to specify an autoregressive moving-average (ARMA) model for the residuals, while modeling change in level and/or trend through adding the exogenous predictors as described above. Other options you can choose from are known in the time series literature as dynamic regression (Hyndman & Athanasopoulos, 2021), interrupted time series analysis (Box & Tiao, 1975), or autoregresive moving-average modeling with exogenous inputs, known as the ARMAX model.

None of these approaches allow for a change in the dynamics themselves however; if that is what you are interested in, you may need to revert to a Markov-switching autoregressive model with an absorbing state or a threshold autoregressive model. These modeling approaches were developed to allow for recurrent switches between two or more distinct regimes, each of which is characterized by its own parameters. Such switches may be triggered by an observed variable, in which case a TAR model can be used, with the triggering observed variable included as the threshold variable; if you use time as the threshold variable, you basically end up with a change point model with short-term dynamics due to autoregression. It is also possible that the switches occur due to some unknown trigger, which can be modeled with a hidden an MSAR model; if one of the states is an absorbing state (meaning the system cannot leave that state onces it has been entered), you basically also have a change point model with short-term dynamics.

While these latter two approaches allow you to have sudden changes in means, trends, variability and dynamics, typically their specification does not use phase-specific detrending of the autoregressive predictors. As a result, the transition between regimes is not as sudden as the model expressions may seem to suggest. You can read more about this—and try it out with the interactive tools that are provided—in the articles about the TAR model and the MSAR model.

Another alternative you may want to consider is a model with time-varying parameters, such as a time-varying autoregressive (TV-AR) model. Such a model is not specifically concerned with regime-switches or phase-transitions, but it may be able to capture a sudden change in specific aspects of the process. Visualizing the evolution of the model parameters over time allows you to see whether—and if so: when—there was a (more or less) sudden change in any of these.

You may be specifically interested in the options offered by change point modeling when you have ILD from an experimental study. In this case, you typically know when the intervention started (in case the intervention was applied over a longer period), or took place (in case the intervention was applied at a single moment in time). While in such designs you know exactly when the intervention took place, you may still consider the use of a change point with an unknown change point location, to account for the possibility that the effect of the intervention may have needed some time to kick in.

5 Takeaway

A change point model can be used when you believe there are sudden changes in the mean, trend, variability and/or dynamics of the process you are interested in. The defining feature is that there is an abrupt change; this may be well combined with smooth changes during the phase prior to as well as the phase after the change point. The timing of the change point may be known, or it may be estimated based on the data.

To estimate a change point model, you can specify specific predictor variables that you include in your model, either with or without a specification of short-term dynamics. By specifying these predictor variables in specific ways, you can directly estimate the changes that took place at the moment of the change point; then, typically, the parameters that characterize the regime after the change are functions of various parameters. For instance, the slope after the change is the sum of the slope before the change plus the change in the slope.

When the timing of the change is not known, this makes estimation more involved, as it requires you to search for the location of the change point. You can achieve this through an exhaustive search in which you simply try out all possible values for the time of the change point. Additionally, not knowing the timing of the change point makes it more challenging to compare the model with a change point to a model without a change point, and to conclude whether or not a change really took place.

Change point models may contain more than one change point, but typically they do not contain more than a few. In addition, the changes tend to be very abrupt. If you believe the process you are interested in is characterized by recurrent switches, or by a switching process that itself is determined by dynamics, or by slowly varying parameters, then the change point model is not appropriate; in these scenarios, you should consider one of the alternative time series models, which is better able to capture the kind of changes you expect to see over time.

6 Further reading

We have collected various topics for you to read more about below.

Read more: Estimation of N=1 models

References

Box, G. E. P., & Tiao, G. C. (1975). Intervention analysis with applications to economic and environmental problems. Journal of the American Statistical Association, 70(349), 70–79.
Hamaker, E. L. (2009). Using information criteria to determine the number of regimes in threshold autoregressive models. Journal of Mathematical Psychology, 53, 518–529. https://doi.org/10.1016/j.jmp.2009.07.006
Hyndman, R. J., & Athanasopoulos, G. (2021). Forecasting: Principles and practice (3rd ed.). OTexts. OTexts.com/fpp3. Accessed on: October 1, 2024.
Ninomiya, Y. (2005). Information criterion for Gaussian change-point model. Statistics and Probability, 72, 237–247. https://doi.org/10.1016/j.spl.2004.10.037
Tong, H. (1993). Non-linear time series: A dynamic system approach. Oxford Science Publications.

Citation

BibTeX citation:
@article{hamaker2026,
  author = {Hamaker, Ellen L. and Hoekstra, Ria H. A.},
  title = {Chang Point Model},
  journal = {MATILDA},
  number = {2026-01-02},
  date = {2026-01-02},
  url = {https://matilda.fss.uu.nl/articles/change-point-model.html},
  langid = {en}
}
For attribution, please cite this work as:
Hamaker, E. L., & Hoekstra, R. H. A. (2026). Chang point model. MATILDA, 2026-01-02. https://matilda.fss.uu.nl/articles/change-point-model.html