Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

cpt_consistent_var

Variance Estimation Consistent Under Change


Description

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

Usage

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

Details

This is the estimator

\hat{σ}^2_{T,t} = T^{-1}≤ft(∑_{s = 1}^t ≤ft(X_s - \bar{X}_t\right)^2 + ∑_{s = t + 1}^{T}≤ft(X_s - \tilde{X}_{T - t} \right)^2\right)

where \bar{X}_t = t^{-1}∑_{s = 1}^t X_s and \tilde{X}_{T - t} = (T - t)^{-1} ∑_{s = t + 1}^{T} X_s. In this implementation, T is computed automatically as length(x) and k corresponds to t, a potential change point.

Value

The estimated change-consistent variance

Examples

CPAT:::cpt_consistent_var(c(rnorm(500, mean = 0), rnorm(500, mean = 1)), k = 500)

CPAT

Change Point Analysis Tests

v0.1.0
MIT + file LICENSE
Authors
Curtis Miller [aut, cre]
Initial release
2018-12-06

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.