Skip to contents

Scans every split point and reports the one maximising the normalised kernel Fisher discriminant ratio of Harchaoui, Moulines and Bach (2008). Because the comparison happens in feature space, the method detects changes in the whole distribution – variance, shape, dependence – not only in the mean, which is what separates it from morie_pelt.

Usage

morie_kcusum(
  x,
  kernel = "gaussian",
  threshold = NULL,
  gamma = 0.1,
  bandwidth = NULL,
  kmin = 2L,
  kmax = NULL
)

Arguments

x

Numeric vector, or a matrix with one observation per row.

kernel

"gaussian" (default) or "linear". Both routes of the paper are available; the linear kernel reduces the statistic to a classical mean-change test.

threshold

Optional decision threshold; when supplied the result carries detected.

gamma

Regularisation added to the pooled covariance.

bandwidth

Gaussian bandwidth; NULL uses the median pairwise distance.

kmin, kmax

Scan range; kmax defaults to n - 2.

Value

A list with estimate (the estimated split index), statistic, kfdr, d1, d2, T (the whole scan), kmin, kmax, gamma, bandwidth, n, method, and when a threshold is given threshold and detected.

References

Harchaoui, Z., Moulines, E. and Bach, F. (2008). Kernel change-point analysis. Advances in Neural Information Processing Systems, 21.

Examples

V <- c(1, 2, 3, 4, 5, 6, 7, 8)
morie_kcusum(V)
#> $estimate
#> [1] 4
#> 
#> $statistic
#> [1] 16.35918
#> 
#> $kfdr
#> [1] 12.65386
#> 
#> $d1
#> [1] 0.7690099
#> 
#> $d2
#> [1] 0.2638973
#> 
#> $T
#> [1]  7.993004 13.706945 16.359176 13.706945  7.993004
#> 
#> $kmin
#> [1] 2
#> 
#> $kmax
#> [1] 6
#> 
#> $gamma
#> [1] 0.1
#> 
#> $bandwidth
#> [1] 3
#> 
#> $n
#> [1] 8
#> 
#> $method
#> [1] "Kernel change-point analysis (Harchaoui-Moulines-Bach 2008)"
#>