Skip to content

grundy95/changepoint.geo

Repository files navigation

changepoint.geo

CRAN status CRAN RStudio mirror downloads R-CMD-check codecov

The goal of changepoint.geo is to implement the high-dimensional changepoint detection method GeomCP described in Grundy et al. (2020). This method allows for the detection of changes in mean and variance in high-dimensional time series. The main function is geomcp().

Installation

You can install the released version of changepoint.geo from CRAN with:

install.packages("changepoint.geo ")

And the development version from GitHub with:

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

Example

This is a basic example which shows the main functionality of the package:

library(changepoint.geo )
#> 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.
#> Loading required package: changepoint.np
#> Loading required package: ggplot2
#> 
#>  Successfully loaded changepoint.geo package version 1.1.1
set.seed(1)
X <- rbind(matrix(rnorm(100*50),ncol=50),matrix(rnorm(100*50,0,2),ncol=50))
ans <- geomcp(X)
summary(ans)
#> Created using changepoint.geo version 1.1.1 
#> Univariate Test Stat :  Normal 
#> Type of penalty      :  MBIC  with value  21.19327 
#> Minimum Segment Length   :  2 
#> Distance Changepoints    :  100 
#> Angle Changepoints   :  100
plot(ans)