Skip to content

Adding changes in second order structure to changepoint package.

Aditya Samantaray edited this page Mar 22, 2019 · 17 revisions

Background

Detecting changes in statistical properties of a time series is important in a large number of fields. A large amount of research has taken place considering changes in mean and variance in time series. However a typical assumption is that the error process is independent.

Similarly more and more users of existing packages, for example changepoint, are facing problems using real world data due to the dependence structures present.

Related work

There are many R packages available for changepoint detection but, to our knowledge, only a limited number that offer change in dependence.

  • wbsts Assumes a zero-mean process and identifies change in the LSW spectrum.
  • TSMCP fits piecewise AR(p) processes with an upper limit on p set by the user, choice of SCAD or MCP approximate methods.
  • segMGarch fits piecewise GARCH models in multivariate time series
  • ecp non-parametric energy test statistic

None of these packages use exact search methodology. ECP is the closest with its probabilistic pruning but the authors accept that the test statistic implemented is not suitable for detecting changes in second order structure.

Details of your coding project

This project will expand the changepoint R package by including functionality to detect changes in second order structure. The function will mirror the functionality of the cpt.mean and cpt.var functions. More specifically:

  • Fork changepoint, with TravisCI for GNU/Linux testing, Appveyor for windows testing and Coveralls for code coverage.
  • Understand the structure of the changepoint package.
  • Port the change in AR1 and AR2 using PELT functionality from EnvCpt to changepoint whilst ensuring EnvCpt still works as expected.
  • Extend the AR1/2 code to AR(p) functionality.
  • Write functionality for a change in LSW autocorrelation based on a recent paper from Chapman, Eckley and Killick (2018+).
  • Write user facing functions and plotting tools.
  • Write some extensive test cases using testthat and building on existing tests in the changepoint package. Goal: 100% coverage in both R and C code by the end of summer. If time allows, port applicable tests back to EnvCpt to increase coverage.
  • Extend the JSS changepoint paper to include how to use the updated package. Include this as a vignette to the package

Expected impact

The update will provide a new and important alternative to the packages currently available. The package will also include models which are not included in existing packages within a familiar framework. Additionally we have received a considerable number of requests for this functionality over the last year so we expect the package to be well used by the community.

Mentors

Students, please contact mentors below after completing at least one of the tests below.

Tests

Easy: Load the changepoint and EnvCpt packages, create a time series with changing AR structure, run only the change in AR1 and AR2 algorithms from EnvCpt NOT using the envcpt function (i.e. using the non-exported functions in the package) and plot the results.

Medium: Fork the changepoint or EnvCpt package on github and write some new tests to increase the code coverage. Commit these back to the main repository.

Hard: Wrap your easy task into an R function that takes arguments to fit a change in AR1/AR2 with or without a trend, remembering to include checks on your code. Write a package which includes tests for your functions. Upload to github and link in TravisCI testing and code coverage via covr.

Solutions of tests

Students, please post a link to your test results here.

  • Name : Basil Singh

    Email : basil@iitk.ac.in, b_singh3@outlook.com

    University : Indian Institute of Technology, Kanpur

    Course : (B.S.) Economic Sciences

    Solution to Easy Test : Solution

    Solution to Medium Test : TODO

    Solution to Hard Test : TODO

  • Name: Rohan Dudeja

    Email: f2016516@pilani.bits-pilani.ac.in , rohanddj@gmail.com

    University: Birla Institute of Technology and Science, Pilani

    Course: Integrated M.Sc Mathematics and B.E Electrical and Electronics Engineering.

    Solution to Easy Test: EasyTask

    Solution to Medium Test: TODO

    Solution to Hard Test: TODO

  • Name : Aditya Samantaray

    Email : b517003@iiit-bh.ac.in, aditya.samantaray1@gmail.com

    University : International Institute of Information Technology, Bhubaneswar

    Course : Computer Engineering

    Solution to Easy Test : EasyTest

    Solution to Medium Test : TODO

    Solution to Hard Test : TODO

Clone this wiki locally