If none of the existing runs explains the new observation well enough,
the prior predictive density,\(p\left(y_{t}\middle|y_{t-1}^{\left(0\right)}\right)\), will
dominate, resulting in a high posterior probability for a regime shift.
As we are mostly interested in retrospective analysis of regime shifts,
we use the smoothed run length probabilities to find the most likely
segmentation of the data or the most likely set of regimes by maximizing
the product of run length probabilities over the whole time series
(Perälä et al. 2016). We can find the maximum among all possible
combinations of regimes or we can focus on some subset of regimes by
setting certain constraints for the regimes. We have decided to set a
constraint for the minimum length of the regimes (\(M\)). This
constraint is not used for the first and the last regimes, though, since
their start and end points can be outside the time frame of our data. We
use uniform priors for the mean and variance parameters in each of the
time series analyzed. The lower and upper limits for the uniform priors
were assigned so that all plausible parameter values were contained in
the intervals. The posterior inference of the observation model
parameters is carried out by a sequential Monte Carlo algorithm (Perälä
et al. 2016), using 100,000 particles.