See the GitHub repository for links to source code and exercises: https://github.com/tdhock/change-tutorial

There are tasks throughout the sections. You may not get time to complete all the tasks within the workshop but feel free to contact me after the workshop if you require support.

Before executing the code in this tutorial Rmd, make sure to install the required packages:

if(!require(changepoint)){
  install.packages('changepoint')
}
## Loading required package: changepoint
## Loading required package: zoo
## 
## Attaching package: 'zoo'
## The following objects are masked from 'package:base':
## 
##     as.Date, as.Date.numeric
## Successfully loaded changepoint package version 2.2.2
##  NOTE: Predefined penalty values changed in version 2.2.  Previous penalty values with a postfix 1 i.e. SIC1 are now without i.e. SIC and previous penalties without a postfix i.e. SIC are now with a postfix 0 i.e. SIC0. See NEWS and help files for further details.
library(changepoint)
if(!require(changepoint.np)){
  install.packages('changepoint.np')
}
## Loading required package: changepoint.np
## Successfully loaded changepoint.np package version 0.0.2
library(changepoint.np)

What are Changepoints?

Changepoint analysis for time series is an increasingly important aspect of statistics. Simply put, a changepoint is an instance in time where the statistical properties before and after this time point differ. With potential changes naturally occurring in data and many statistical methods assuming a “no change” setup, changepoint analysis is important in both applied and theoretical statistics.

The first published article concerning changepoints was in 1954 by E.S. Page. This considered testing for a potential single changepoint for data from a common parametric distribution and was motivated by a quality control setting in manufacturing. Over the decades, changepoint analysis has developed rapidly with multiple changepoints, different types of data and other assumptions being considered.

Changepoints also appear under a variety of synonyms across a variety of scientific fields. This includes segmentation, structural breaks, break points, regime switching and detecting disorder. Changepoints can be found in a wide range of literature including quality control, economics, medicine, environment, linguistics, .

Mathematically speaking, for data \(z_1, \ldots, z_n\), if a changepoint exists at \(\tau\), then \(z_1,\ldots,z_{\tau}\) differ from \(z_{\tau+1},\ldots,z_n\) in some way. There are many different types of change.