Return a solution with the given number of change-points or change-point-type features from the solution path
model.fixednum(cptpath.object, fixednum = NULL)An S3 object of class cptmodel, which contains the following fields:
The solution path method used to obtain cptpath.object
The model type used, inherited from the given cptpath.object
The model selection method used to return the final change-point or change-point-type feature estimators object, here its value is "ic"
The number of estimated features in the mean of the vector cptpath.object$x based on the given type of the model
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
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.
A solution-path object, returned by a sol.[name] routine. Note that the field cptpath.object$x contains the input data sequence.
The number of change-points or change-point-type features
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.
sol.idetect, sol.not, sol.tguh, sol.wbs, sol.wbs2, sol.wcm, breakfast
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)
Run the code above in your browser using DataLab