# metricChangePoint: Change Point Detection in Metric Spaces In speegled/cpbaywave: Bayesian Wavelet based Change Point Detection

 metricChangePoint R Documentation

## Change Point Detection in Metric Spaces

### Description

Determines the most likely locations of a change point in distribution of elements in a metric space. Forms a new time series which is the pairwise distance matrix; the diagonal is replaced by average value of nearby elements. Then, dimension reduction change point detection is called. If useBootstrap is TRUE, then a bootstrapped confidence interval for possible change points is computed.

### Usage

``````metricChangePoint(
multiSeries,
distance,
useGaussian = TRUE,
useBFIC = TRUE,
useMetricProject = FALSE,
setdetail,
reducedDim = 10,
useBootstrap = FALSE
)
``````

### Arguments

 `multiSeries` The high dimensional time series. Should be a matrix, with each row being an observation of the time series. `distance` A function that returns the distance between two rows of multiSeries. `useGaussian` Set to TRUE if you want to use a random Gaussian projection. Set to FALSE for random Bernoulli matrix. `useBFIC` Optional argument to use BFIC to decide change point location. `setdetail` Optional argument to set the detail level you wish to use. Default is all details except one. `reducedDim` The dimension you want to project onto. Should be less than the dimension of the time series. Default is 10. `useBootstrap` Set to true if you wish to bootstrap a cutoff for significance of indices. `...` Additional parameters passed to the distance function

### Examples

``````
dim=10
sig1=diag(dim)
mu1=rep(0,dim)
mu2=rep(1.5,dim)
n=128
tau=30
series1=createTimeSeries(mu1, mu2, sig1, n, tau)
sn=sin(2.5*pi*1:n/n)
series2=sn+series1
myDistance <- function(x,y) {
sum(abs(x - y))
}
metricChangePoint(series2, myDistance) #True change point is at t = 30

``````

speegled/cpbaywave documentation built on Feb. 19, 2024, 11:13 a.m.