# CUSUM.test: CUSUM Test In CPAT: Change Point Analysis Tests

## Description

Performs the (univariate) CUSUM test for change in mean, as described in \insertCitehorvathricemiller19CPAT. This is effectively an interface to stat_Vn; see its documentation for more details. p-values are computed using pkolmogorov, which represents the limiting distribution of the statistic under the null hypothesis.

## Usage

 1 2 CUSUM.test(x, use_kernel_var = FALSE, stat_plot = FALSE, kernel = "ba", bandwidth = "and") 

## Arguments

 x Data to test for change in mean use_kernel_var Set to TRUE to use kernel methods for long-run variance estimation (typically used when the data is believed to be correlated); if FALSE, then the long-run variance is estimated using \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 stat_plot Whether to create a plot of the values of the statistic at all potential change points kernel If character, the identifier of the kernel function as used in cointReg (see getLongRunVar); if function, the kernel function to be used for long-run variance estimation (default is the Bartlett kernel in cointReg) bandwidth If character, the identifier for how to compute the bandwidth as defined in cointReg (see getBandwidth); if function, a function to use for computing the bandwidth; if numeric, the bandwidth value to use (the default is to use Andrews' method, as used in cointReg)

## Value

A htest-class object containing the results of the test

\insertAllCited

## Examples

 1 2 3 CUSUM.test(rnorm(1000)) CUSUM.test(rnorm(1000), use_kernel_var = TRUE, kernel = "bo", bandwidth = "nw") 

### Example output

Package 'CPAT' version 0.1.0
Type citation("CPAT") for citing this R package in publications

CUSUM Test for Change in Mean

data:  rnorm(1000)
A = 0.66551, p-value = 0.7676
sample estimates:
t*
750

CUSUM Test for Change in Mean

data:  rnorm(1000)
A = 0.65395, p-value = 0.7859
sample estimates:
t*
359


CPAT documentation built on May 1, 2019, 6:51 p.m.