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

andrews_test

Univariate Andrews Test for End-of-Sample Structural Change


Description

This implements Andrews' test for end-of-sample change, as described by Andrews (2003). This test was derived for detecting a change in univariate data. See (Andrews 2003) for a description of the test.

Usage

andrews_test(x, M, pval = TRUE, stat = TRUE)

Arguments

x

Vector of the data to test

M

Numeric index of the location of the first potential change point

pval

If TRUE, return a p-value

stat

If TRUE, return a test statistic

Value

If both pval and stat are TRUE, a list containing both; otherwise, a number for one or the other, depending on which is TRUE

References

Andrews DWK (2003). “End-of-Sample Instability Tests.” Econometrica, 71(6), 1661–1694. ISSN 00129682, 14680262, https://www.jstor.org/stable/1555535.

Examples

CPAT:::andrews_test(rnorm(1000), M = 900)

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.