
Kernel change-point analysis (KFDR running-maximum scan)
Source:R/w501_changepoint_native.R
KernelCusum.RdHarchaoui, 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
)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)"
#>