model.fixednum {breakfast}R Documentation

Estimate the location of change-points when the number of them is fixed

Description

Return a solution with the given number of change-points or change-point-type features from the solution path

Usage

model.fixednum(cptpath.object, fixednum = NULL)

Arguments

cptpath.object

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

fixednum

The number of change-points or change-point-type features

Details

The model selection method which returns results with a given number of change-points or change-point-type features. If there are multiple such elements on the solution path, the one with the smaller residual sum of squares will be returned. On the other hand, if no such element exists, an empty set (i.e. with no change-points) will be returned.

Value

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

solution.path

The solution path method used to obtain cptpath.object

type

The model type used, inherited from the given cptpath.object

model.selection

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

no.of.cpt

The number of estimated features in the mean of the vector cptpath.object$x based on the given type of the model

cpts

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

est

An estimate of the mean of the vector cptpath.object$x; for piecewise-constant signals, the values are the sample means of the data (replicated a suitable number of times) between each pair of consecutive detected change-points; for piecewise-linear but discontinuous signals, the values are the estimated linear trend (replicated a suitable number of times) between each pair of consecutive detected change of slopes; for piecewise-linear and continuous signals, it is similar to the previous case but with the continuity constraint enforced, which envolves solving a global least squares problem.

See Also

sol.idetect, sol.not, sol.tguh, sol.wbs, sol.wbs2, sol.wcm, breakfast

Examples

x <- c(rep(0, 100), rep(1, 100), rep(0, 100)) + rnorm(300)
model.fixednum(sol.wbs(x),2)
model.fixednum(sol.not(x),2)

[Package breakfast version 2.4 Index]