tguh.cpt {breakfast} | R Documentation |
This function estimates the number and locations of change-points in the piecewise-constant mean of the noisy input vector, using the Tail-Greedy Unbalanced Haar method (see Details for the relevant literature reference). It also estimates the constant means between each pair of neighbouring change-points. It works best when the noise in the input vector is independent and identically distributed Gaussian.
tguh.cpt(x, sigma = stats::mad(diff(x)/sqrt(2)), th.const = 1, p = 0.01, minseglen = 1, bal = 1/20, num.zero = 10^(-5))
x |
A vector containing the data in which you wish to find change-points. |
sigma |
The estimate or estimator of the standard deviation of the noise in |
th.const |
Tuning parameter. Change-points are
estimated by connected thresholding (of the Tail-Greedy Unbalanced Haar decomposition of |
p |
Specifies the number of region pairs merged in each pass through the data, as the proportion of all remaining region pairs. The default is 0.01. |
minseglen |
The minimum permitted length of each segment of constancy in the estimated mean of |
bal |
Specifies the minimum ratio of the length of the shorter wing of each Unbalanced Haar wavelet whose coefficient survives the thresholding, to the length of its support. The default is 0.05. |
num.zero |
Numerical zero; the default is 0.00001. |
The change-point detection algorithm used in tguh.cpt
is the
Tail-Greedy Unbalanced Haar method as described in "Tail-greedy bottom-up data
decompositions and fast multiple change-point detection", P. Fryzlewicz (2017),
preprint. This paper describes two optional post-processing steps; neither of
them is implemented in this package.
A list with the following components:
est |
The estimated piecewise-constant mean of |
no.of.cpt |
The estimated number of change-points in the piecewise-constant mean of |
cpt |
The estimated locations of change-points in the piecewise-contant mean of |
Piotr Fryzlewicz, p.fryzlewicz@lse.ac.uk
segment.mean
, hybrid.cpt
, tguh.decomp
, tguh.denoise
, tguh.reconstr
stairs <- rep(1:50, each=10) stairs.noisy <- stairs + rnorm(500)/5 stairs.cleaned <- tguh.cpt(stairs.noisy) ts.plot(stairs.cleaned$est) stairs.cleaned$no.of.cpt stairs.cleaned$cpt