knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)
library(changepoint.cov)

changepoint.cov

R-CMD-check codecov

The goal of changepoint.cov is to provide methods for detecting covariance or subspace changepoints in multivariate time series.

Installation

You can install the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("grundy95/changepoint.cov")

Example

These basic examples show how to use the 2 main functions: cptCov for detecting changes in covariance and cptSubspace for detecting changes in subspace.

cptCov

For detecting covariance changepoints in high-dimensional independent time series, we recommend using method='Ratio'.

set.seed(1)
data <- wishartDataGeneration(n=200,p=30,tau=100)$data

ansRatio <- cptCov(X=data, method='Ratio')
summary(ansRatio)
plot(ansRatio)

For detecting covariance changes in low-dimensional, potentially dependent time series we recommend using method='CUSUM'.

set.seed(1)

data <- wishartDataGeneration(n=200,p=3,tau=c(50,150))$data

ansCUSUM <- cptCov(X=data, method='CUSUM', numCpts='BinSeg', threshold='Manual', thresholdValue=7)
show(ansCUSUM)
cptsSig(ansCUSUM)
covEst(ansCUSUM)

cptSubspace

For detecting subspace changepoints in high-dimensional data using the cptSubspace function.

set.seed(1)
data <- subspaceDataGeneration(n=100,p=20,subspaceDim=5,tau=50,changeSize=0.5*sqrt(5))$data
ansSubspace <- cptSubspace(X=data, subspaceDim=5, nperm=100)
summary(ansSubspace)
subspaceEst(ansSubspace)


grundy95/changepoint.cov documentation built on April 5, 2021, 6:21 p.m.