Learn R Programming

High-Dimensional Change-point Detection

HDCD contains efficient implementations of several multiple change-point detection algorithms, including Efficient Sparsity Adaptive Change-point estimator (ESAC) and Informative sparse projection for estimating change-points (Inspect).

Installation

You can install the development version of HDCD from GitHub with:

# install.packages("devtools")
devtools::install_github("peraugustmoen/HDCD")

Example

This is a basic example which shows you how to run ESAC:

library(HDCD)
n = 50
p = 50
set.seed(100)
# Generating data
X = matrix(rnorm(n*p), ncol = n, nrow=p)
# Adding a single sparse change-point (at location \eta = 25):
X[1:5, 26:n] = X[1:5, 26:n] +2

# Vanilla ESAC:
res = ESAC(X)
res$changepoints
#> [1] 25

# Manually setting leading constants for \lambda(t) and \gamma(t)
res = ESAC(X,
           threshold_d = 2, threshold_s = 2, #leading constants for \lambda(t)
           threshold_d_test = 2, threshold_s_test = 2 #leading constants for \gamma(t)
)
res$changepoints #estimated change-point locations
#> [1] 25

# Empirical choice of thresholds:
res = ESAC(X, empirical = TRUE, N = 100, tol = 1/100)
res$changepoints
#> [1] 25


# Manual empirical choice of thresholds (equivalent to the above)
thresholds_emp = ESAC_calibrate(n,p, N=100, tol=1/100)
res = ESAC(X, thresholds_test = thresholds_emp[[1]])
res$changepoints
#> [1] 25

Copy Link

Version

Install

install.packages('HDCD')

Monthly Downloads

562

Version

1.0

License

GPL-3

Maintainer

Moen Per August Jarval

Last Published

November 19th, 2023

Functions in HDCD (1.0)

single_SBS_calibrate

Generates threshold \(\pi_T\) for Sparsified Binary Segmentation for single change-point detection
Pilliat_test_calibrate

Generates detection thresholds for the Pilliat algorithm for testing for a single change-point using Monte Carlo simulation
ARI

ARI
CUSUM

CUSUM transformation of a matrix
ESAC_test

ESAC single change-point test
ESAC_test_calibrate

Generates empirical penalty function \(\gamma(t)\) for single change-point testing using Monte Carlo simulation
single_CUSUM

CUSUM transformation of matrix at a specific position
Inspect_test

Inspect single change-point test
Inspect_test_calibrate

Generates empirical detection threshold \(\xi\) for single change-point testing using Monte Carlo simulation
Pilliat_test

Pilliat single change-point test
single_Inspect

Inspect for single change-point estimation
single_ESAC

Efficient Sparsity Adaptive Change-point estimator for a single change-point
ESAC

Efficient Sparsity Adaptive Change-point estimator
single_SBS

Sparsified Binary Segmentation for single change-point estimation
ESAC_calibrate

Generates empirical penalty function \(\gamma(t)\) for the ESAC algorithm using Monte Carlo simulation
Inspect

Informative sparse projection for estimating change-points (Inspect)
Inspect_calibrate

Generates empirical detection threshold \(\xi\) using Monte Carlo simulation
hausdorff

Hausdorff distance between two sets
rescale_variance

Re-scales each row of matrix by its MAD estimate
Pilliat

Pilliat multiple change-point detection algorithm
Pilliat_calibrate

Generates detection thresholds for the Pilliat algorithm using Monte Carlo simulation