model.gsa {breakfast} | R Documentation |

## Estimating change-points in the piecewise-constant mean of a noisy data sequence with auto-regressive noise via gappy Schwarz algorithm

### Description

This function estimates the number and locations of change-points in the piecewise-constant mean of a noisy data sequence with auto-regressive noise via gappy Schwarz algorithm
from a candidate model sequence generated by `sol.wcm`

.

### Usage

```
model.gsa(cptpath.object, p.max = 10, pen = log(length(cptpath.object$x))^1.01)
```

### Arguments

`cptpath.object` |
A solution-path object, returned by a |

`p.max` |
The maximum AR order. The default is |

`pen` |
Penalty used for the Schwarz criterion. |

### Details

From the largest to the smallest (i.e. empty) candidate models generated by `sol.wcm`

,
gappy Schwarz algorithm locally evaluates the Schwarz criterion (SC, under piecewise constant signal + AR(p) noise model, with the AR order p to be determined adaptively) and its modification SC0
on each segment determined by the next smallest candidate model. It selects the larger model as the final model if over each segment, all newly introduced estimators are deemed ‘significant’ according to SC and SC0; see Cho and Fryzlewicz (2023) for details.

### Value

An S3 object of class `cptmodel`

, which contains the following fields:

`solution.path` |
The solution path method used to obtain |

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

`no.of.cpt` |
The number of estimated change-points in the piecewise-constant mean of the vector |

`cpts` |
The locations of estimated change-points in the piecewise-constant mean of the vector |

`est` |
An estimate of the piecewise-constant mean of the vector |

### References

H. Cho & P. Fryzlewicz (2024) Multiple change point detection under serial dependence: Wild contrast maximisation and gappy Schwarz algorithm. *Journal of Time Series Analysis*, 45(3): 479–494.

### See Also

### Examples

```
set.seed(111)
f <- rep(c(0, 5, 2, 8, 1, -2), c(100, 200, 200, 50, 200, 250))
x <- f + arima.sim(list(ar = c(.75, -.5), ma = c(.8, .7, .6, .5, .4, .3)), n = length(f), sd = 1)
model.gsa(sol.wcm(x))
```

*breakfast*version 2.4 Index]