Helper to construct standard penalty values for use with changepoint detection methods. Returns a numeric penalty value.
Arguments
- type
Penalty type:
"None","BIC"(or"SIC"),"MBIC","AIC","Hannan-Quinn","sSIC", or"Manual".- n
Series length (at least 3 for the \(\log n\)-based penalties). Required for BIC, MBIC, AIC, Hannan-Quinn, sSIC.
- k
Number of parameters per changepoint (typically 2 for mean+variance, 1 for mean-only). Defaults to 1. The
"MBIC"penalty additionally readskas the number of changepoints being placed, in its \(\log{n \choose k}\) term.- value
Numeric value for
Manualtype.- alpha
Exponent of the strengthened SIC (
"sSIC") penalty \(k (\log n)^\alpha\); must exceed 1. Defaults to1.01(Fryzlewicz, 2014).- series
The series a learned penalty is predicted for. Required only when
typeis aggcpt_penalty_modelfromcpt_learn_penalty(), in which case every other argument is ignored and the model's prediction for this series is returned.
Penalty semantics across engines
The same penalty name may be interpreted differently by different engines:
changepoint-based methods (PELT, BinSeg, SegNeigh, AMOC): accept character penalties (
"MBIC","BIC","AIC","Hannan-Quinn","None") and pass them to the upstream changepoint package. A numeric penalty is translated to that package'spenalty = "Manual"pluspen.value. The one exception is Segment Neighbourhood, for which changepoint does not implement MBIC:cpt_detect(method = "segneigh")andcpt_wrapper(cp_method = "SegNeigh")therefore fall back to"SIC"when the default penalty is left in place, so a segneigh result is not directly penalty-comparable with a PELT one. Passpenaltyexplicitly to pin it. For a change in mean these engines also read the penalty on the data's own scale rather than a standardised one; see the scale-sensitivity section ofcpt_detect.Functional-pruning methods (
fpop,cpop,decafs): accept numeric penalties only. When a character penalty is supplied viacpt_detect(), it is resolved to a numeric value usingcpt_penalty()before dispatch.Search-based methods (WBS, WBS2, NOT, MOSUM, IDetect, TGUH): use internal model-selection criteria (e.g., sSIC, threshold) and generally ignore the
penaltyargument. Specify thresholds via the wrapper's own arguments.Inference/Bayesian methods (
smuce,bcp,bocpd,beast,cpm,sn): are tuned by a significance level, posterior-probability threshold, hazard, or average run length rather than a penalty; see each wrapper.MBICincpt_penalty()is a BIC-type penalty that adds a combinatorial term for the number of wayskchangepoints can be placed innobservations, \(0.5(k+1)\log n + \log{n \choose k}\). It is deliberately stronger than"BIC". It is not the modified BIC of Zhang and Siegmund (2007), whose penalty \(1.5 k \log n + 0.5 \sum_i \log(l_i / n)\) depends on the segment lengths \(l_i\) and so cannot be expressed by a function ofnandkalone. Use the character"MBIC"with changepoint-based methods to get the engine's native MBIC.
