model.thresh {breakfast}R Documentation

Estimating change-points in the piecewise-constant mean of a noisy data sequence via thresholding

Description

This function estimates the number and locations of change-points in the piecewise-constant mean of a noisy data sequence via thresholding.

Usage

model.thresh(
  cptpath.object,
  sigma = stats::mad(diff(cptpath.object$x)/sqrt(2)),
  th_const = 1.15
)

Arguments

cptpath.object

A solution-path object, returned by a sol.[name] routine. Note that the field sols.object$x contains the input data sequence.

sigma

An estimate of the standard deviation of the noise in the data cptpath.object$x. Can be a functional of cptpath.object$x or a specific value if known. The default is the Median Absolute Deviation of the vector diff(cptpath.object$x)/sqrt(2), tuned to the Gaussian distribution. Note that model.thresh works particularly well when the noise is i.i.d. Gaussian.

th_const

A positive real number with default value equal to 1. It is used to define the threshold for the detection process.

Value

An S3 object of class cptmodel, which contains the following fields:

solution.path

The solution path method used to obtain cptpath.object

model.selection

The model selection method used to return the final change-point estimators object, here its value is "thresh"

no.of.cpt

The number of estimated change-points in the piecewise-constant mean of the vector cptpath.object$x

cpts

The locations of estimated change-points in the piecewise-constant mean of the vector cptpath.object$x. These are the end-points of the corresponding constant-mean intervals

est

An estimate of the piecewise-constant mean of the vector cptpath.object$x; the values are the sample means of the data (replicated a suitable number of times) between each pair of consecutive detected change-points

See Also

sol.idetect_seq, sol.idetect_seq, sol.not, sol.tguh, sol.wbs, sol.wbs2, breakfast

Examples

f <- rep(rep(c(0, 1), each = 50), 10)
x <- f + rnorm(length(f))
model.thresh(sol.idetect_seq(x))

[Package breakfast version 2.2 Index]