andrews_test function

Univariate Andrews Test for End-of-Sample Structural Change

Univariate Andrews Test for End-of-Sample Structural Change

This implements Andrews' test for end-of-sample change, as described by if(!exists(".Rdpack.currefs")) .Rdpack.currefs <-new.env();Rdpack::insert_citeOnly(keys="andrews03;textual",package="CPAT",cached_env=.Rdpack.currefs) . This test was derived for detecting a change in univariate data. See if(!exists(".Rdpack.currefs")) .Rdpack.currefs <-new.env();Rdpack::insert_citeOnly(keys="andrews03",package="CPAT",cached_env=.Rdpack.currefs) for a description of the test.

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

Returns

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

Examples

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

References

if(!exists(".Rdpack.currefs")) .Rdpack.currefs <-new.env();Rdpack::insert_all_ref(.Rdpack.currefs)

  • Maintainer: Curtis Miller
  • License: MIT + file LICENSE
  • Last published: 2018-12-25

Useful links