make_linear_chi2_penalty#
- make_linear_chi2_penalty(n_params_per_variable: int, n: int, p: int) ndarray [source][source]#
Create a linear chi-square penalty.
The penalty is a piece of the default penalty for the MVCAPA algorithm. It is described as “penalty regime 2” in the MVCAPA article [1], suitable for detecting sparse anomalies in the data. Sparse anomalies only affect a few variables.
- Parameters:
- n_params_per_variable: int
Number of model parameters per variable and segment.
- nint
Sample size.
- pint
Number of variables/columns in the data being analysed.
- Returns:
- np.ndarray
The non-decreasing linear chi-square penalty values. The shape is
(p,)
. Elementi
of the array is the penalty value fori+1
variables being affected by a change or anomaly.
References
[1]Fisch, A. T., Eckley, I. A., & Fearnhead, P. (2022). Subset multivariate segment and point anomaly detection. Journal of Computational and Graphical Statistics, 31(2), 574-585.