Penalties#

Penalties govern the trade-off between the number of changepoints in the model and the fit of the model. They are used by all detectors in Skchange. Helper functions are provided for the commonly used penalty shapes.

Constant penalties#

The penalty for each additional changepoint is constant.

bic_penalty(n_samples[, n_params, ...])

Create a Bayesian Information Criterion (BIC) penalty.

chi2_penalty(n_samples[, n_params])

Create a chi-square penalty.

Linear penalties#

The penalty for each additional changepoint is linear in the number of variables affected by the change. Only relevant for multivariate data. Some detectors use such penalties to identify the variables responsible for the change or anomaly. Penalised scores using linear penalties are faster to compute than non-linear penalties.

linear_penalty(n_features, intercept, slope)

Create a linear penalty.

linear_chi2_penalty(n_samples, n_features[, ...])

Create a linear chi-square penalty.

Nonlinear penalties#

The penalty for each additional changepoint is non-linear in the number of variables affected by the change. Only relevant for multivariate data.

nonlinear_chi2_penalty(n_samples, n_features)

Create a nonlinear chi-square penalty.

mvcapa_penalty(n_samples, n_features[, ...])

Create the default penalty for the MVCAPA algorithm.