Skip to contents

Harchaoui, Moulines and Bach (2008): for each candidate k the kernel Fisher discriminant ratio \(KFDR = \frac{k(n-k)}{n} \| (\Sigma_W + \gamma I)^{-1/2} (\hat\mu_{k+1:n} - \hat\mu_{1:k}) \|^2\) with within-class operator \(n \Sigma_W = k \hat\Sigma_{1:k} + (n-k) \hat\Sigma_{k+1:n}\), studentised as \(T(k) = (KFDR - d_1)/\sqrt{2 d_2}\) with \(d_1 = tr[(\Sigma_W + \gamma I)^{-1}\Sigma_W]\), \(d_2 = tr[(\Sigma_W + \gamma I)^{-2}\Sigma_W^2]\); the estimate is the running maximum over k (their Sec. 2-3). Operators are represented on the span of the mapped sample via the Gram-matrix eigendecomposition; the reported scalars are basis-invariant.

Usage

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

Arguments

x

Numeric vector or matrix with observations in rows.

kernel

"gaussian" (median-heuristic bandwidth default) or "linear".

threshold

Optional decision threshold for max T(k).

gamma

Ridge regularisation.

bandwidth

Gaussian bandwidth; default median heuristic.

kmin, kmax

Scan interval, 1 < k < n.

Value

List with estimate (k_hat), statistic (max T), kfdr, d1, d2, T, detected (if threshold given), bandwidth, gamma.

References

Harchaoui, Z., Moulines, E. and Bach, F. R. (2008), Kernel change-point analysis, Advances in Neural Information Processing Systems 21, 609-616. Section 3 (KFDR, d1/d2, scan statistic), Section 2 (running maximum strategy), Corollary 2.

Examples

V <- c(1, 2, 3, 4, 5, 6, 7, 8)
KernelCusum(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)"
#>