cpt_consistent_var function

Variance Estimation Consistent Under Change

Variance Estimation Consistent Under Change

Estimate the variance (using the sum of squared errors) with an estimator that is consistent when the mean changes at a known point.

cpt_consistent_var(x, k)

Arguments

  • x: A numeric vector for the data set
  • k: The potential change point at which the data set is split

Returns

The estimated change-consistent variance

Details

This is the estimator

σ^T,t2=T1(s=1t(XsXˉt)2+s=t+1T(XsX~Tt)2) \hat{\sigma}^2_{T,t} = T^{-1}\left(\sum_{s = 1}^t \left(X_s -\bar{X}_t\right)^2 + \sum_{s = t + 1}^{T}\left(X_s - \tilde{X}_{T - t}\right)^2\right)

where Xˉt=t1s=1tXs\bar{X}_t = t^{-1}\sum_{s = 1}^t X_s and c("tildeXTt=\n\\tilde{X}_{T - t} =\n", "(Tt)1sums=t+1TXs(T - t)^{-1} \\sum_{s = t + 1}^{T} X_s"). In this implementation, TT is computed automatically as length(x) and k corresponds to tt, a potential change point.

Examples

CPAT:::cpt_consistent_var(c(rnorm(500, mean = 0), rnorm(500, mean = 1)), k = 500)
  • Maintainer: Curtis Miller
  • License: MIT + file LICENSE
  • Last published: 2018-12-25

Useful links