# mcp: Regression with Multiple Change Points

An R package that fits Bayesian regression models with one or more change points between linear or generalized linear segments.

mcp is an R package for regression with one or multiple change points, the points where data shifts from being better explained by one linear segment to the next. These are also known in other fields as switch points, break points, or segmented, piecewise, or discontinuity models, and mcp aims to support all of them within one interface.

A model is specified as a list of formulas, one per segment, and mcp turns this formula representation into JAGS code and fits it with Bayesian inference, using tidybayes, bayesplot, coda, and loo for analysis and plotting. It reports fitted lines, change-point posterior densities, and posterior summaries with sampling diagnostics.

It installs from CRAN or from GitHub with remotes, and requires JAGS to be installed separately.

Website: http://lindeloev.github.io/mcp
