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 |

`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 |

`type` |
The model type used, inherited from the given |

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

`no.of.cpt` |
The number of estimated features in the mean of the vector |

`cpts` |
The locations of estimated features in the mean of the vector |

`est` |
An estimate of the mean of the vector |

### 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)
```

*breakfast*version 2.4 Index]