How this calculation works
A multiple change-point model divides an ordered series into segments with potentially different means. It averages across competing boundary locations instead of choosing a single jump and treating that choice as certain.
ExactGaussianproductpartitionversion:knownnoisevariance sigma²;segmentmean independentlyN(mu0,tau²);priorboundaryindicatorsiidBernoulli(h) betweenobservations. Segmentmarginal m(a,b)=N(y_segment;mu0*1,sigma²I+tau²11^T), computeviaSSE,meananddet sigma^(2(m-1))*(sigma²+m*tau²). Enumerateallpartitionsonlyn≤20oruseforwardbackwardDP: productsegmentmarginals times h perboundary and(1-h) pernonboundary. Returnboundaryposterior,segmentposterior,posteriornumberchanges andMAPpartition withsameprior. This is exactnewstatedmodel,not the specific bcp Barry-Hartigan MCMC.A worked example
With the prefilled inputs, expectedChangepoints = 1.2878470012900953.
Good to know
Independent segment means Normal(priorMean,priorVariance), known Gaussian noise; Bernoulli cut prior restricted to minimum-length partitions. Evidence excludes prior restriction normalizer; posterior segmentation is normalized.
Reference: Primary method reference or author-maintained documentation (opens in a new tab) ↗
Allow more than one change
A multiple change-point model divides an ordered series into segments with potentially different means. It averages across competing boundary locations instead of choosing a single jump and treating that choice as certain.
Order carries meaning: sorting values by magnitude would destroy the temporal or spatial sequence being analyzed. Supply observations in their actual sequence with a consistent measurement interval.
Compare with the Pettitt rank change point test calculator with permutation significance. Infer a posterior distribution over segmentations and uncertain change locations; Pettitt tests one rank change and does not average segmentations.
Specify the Gaussian segment model
Use the prefilled input structure and preserve the declared column or index order. In this bounded model, observation variance is known and each segment mean receives an independent normal prior. The prior mean and variance determine how strongly short segments shrink toward the reference level.
This is a stated conjugate model, not an automatic reproduction of every Bayesian change-point package. Unknown variance, serial dependence and regression trends require additional assumptions and calculations. The sequence is modeled with known Gaussian observation variance and independent normal priors on segment means. The user supplies that mean prior's center and variance, a cut probability and a minimum segment length. These choices define a particular product-partition model; they are not automatically equivalent to every Bayesian change-point package. Temporal order matters: sorting observations before entry would remove the question of where a change occurred. The minimum length prevents some segmentations and can move posterior mass onto nearby cuts even when the observed jump itself is unchanged.
Choose the boundary prior
The hazard parameter assigns a prior chance of a boundary between adjacent observations. With independent boundary indicators, a partition's prior also accounts for all positions where a boundary is absent.
A larger hazard favors more segments before the data are considered. Report it with the mean prior so that a high posterior change probability is not interpreted without its prior context.
Integrate segment means
Each candidate segment contributes a marginal likelihood after its unknown mean has been integrated out. The resulting score rewards a stable local level while penalizing unsupported short segments through the prior.
Forward-backward dynamic programming combines those segment scores without enumerating every full partition. Boundary probabilities are obtained by summing over all complete segmentations containing the boundary, rather than reading them from only the best partition.
A two-observation posterior
Take y=(0,0), observation variance one, prior mean zero, prior mean variance one and boundary hazard one-half. One shared segment has marginal density1/(2π√3), while two separate segments have density1/(4π).
The posterior probability of the intervening boundary is therefore√3/(2+√3), approximately0.4641. Identical observations do not force zero change probability because the posterior still averages over both allowed partitions.
Distinguish boundary and segment certainty
A boundary probability describes a particular gap between observations. A segment probability concerns an entire interval with both endpoints fixed, while the posterior number of changes sums across complete partitions.
A maximum-posterior partition is one concise summary, but it can hide uncertainty between nearby alternative boundaries. Display the boundary profile or segment probabilities alongside that single partition.
Check dependence and interpretation
Autocorrelated noise can resemble a sequence of mean shifts when the model assumes independent errors. Outliers can also create short, apparently distinct segments.
Use the result to assess mean-change uncertainty under the supplied noise and prior assumptions. A boundary does not identify its cause, and a small posterior probability does not prove that a series is stable under every plausible model. Dynamic programming sums the integrated segment likelihoods over all admissible partitions, then uses backward messages for marginal cut probabilities. A separate maximizing calculation gives a MAP partition. The most probable individual cut locations need not combine into the MAP partition, because segment boundaries interact through admissibility and the model evidence. The evidence value displayed here omits the normalizing constant for the minimum-length restriction on the prior; posterior cut probabilities are nevertheless normalized over the allowed partitions. Do not compare that unnormalized evidence across different minimum lengths as if the omitted constants canceled. The implementation does not fit an unknown noise variance or a trending within-segment mean. Independent segment means Normal(priorMean,priorVariance), known Gaussian noise; Bernoulli cut prior restricted to minimum-length partitions. Evidence excludes prior restriction normalizer; posterior segmentation is normalized.
A few questions, answered
Does this estimate the noise variance?
Not in the stated known-variance mode; enter a justified positive value.
Is a boundary probability the probability of the best partition?
No. It sums the posterior mass of every allowed partition containing that boundary.
Why can identical observations still have a nonzero change probability?
The model assigns prior mass to separate segments and integrates their uncertain means rather than imposing a deterministic equality rule.
Can serial correlation create apparent changes?
Yes. Dependence not represented by the noise model can be mistaken for changes in the segment mean.