criteria {crossvalidationCP}R Documentation

Pre-implemented cross-validation criteria

Description

criterionL1loss, criterionMod and criterionL2loss compute the cross-validation criterion with L1-loss, the modified criterion and the criterion with L2-loss for univariate data, see (15), (16), and (6) in Pein and Shah (2021), respectively. If value is given (i.e. value =! NULL), then value replaces the empirical means. All criteria can be passed to the argument criterion in the cross-validation functions, see the functions listed in See Also.

Usage

criterionL1loss(testset, estset, value = NULL, ...)
criterionMod(testset, estset, value = NULL, ...)
criterionL2loss(testset, estset, value = NULL, ...)

Arguments

testset

a numeric vector giving the observations in the test set / fold. For criterionMod, if length(testset) == 1L, NaN will be returned, see Details

estset

a numeric vector giving the observations in the estimation set

value

a single numeric giving the local value on the segment or NULL. If NULL the value will be mean(estset)

...

unused

Details

criterionMod requires that the minimal segment length is at least 2. So far the only pre-implemented estimators that allows for such an option are pelt and binseg, where one can specify minseglen in ....

Value

a single numeric

References

Pein, F., and Shah, R. D. (2021) Cross-validation for change-point regression: pitfalls and solutions. arXiv:2112.03220.

See Also

crossvalidationCP, VfoldCV, COPPS, CV1, CVmod

Examples

# all functions can be called directly, e.g.
Y <- rnorm(100)
criterionL1loss(testset = Y[seq(1, 100, 2)], estset = Y[seq(2, 100, 2)])

# but their main purpose is to serve as the criterion in the cross-validation functions, e.g.
crossvalidationCP(rnorm(100), criterion = criterionL1loss)

[Package crossvalidationCP version 1.1 Index]