DP.poly {changepoints} R Documentation

## Dynamic programming algorithm for univariate polynomials change points detection.

### Description

Perform dynamic programming algorithm for univariate polynomials change points detection.

### Usage

DP.poly(y, r, gamma, delta)


### Arguments

 y A numeric vector of observations. r An integer scalar order of polynomials. gamma A numeric scalar of the tuning parameter associated with the l_0 penalty. delta A strictly integer scalar of minimum spacing.

### Value

A list with the following structure:

An object of class "DP", which is a list with the following structure:

 partition A vector of the best partition. yhat A vector of mean estimation for corresponding to the best partition. cpt A vector of change points estimation.

Haotian Xu

### References

Yu and Chatterjee (2020) <arXiv:2007.09910>

### Examples

set.seed(0)
cpt_true = c(20, 50, 170)
y = rnorm(300) + c(rep(0,20),rep(2,30),rep(0,120),rep(2,130))
plot.ts(y)
temp = DP.poly(y, r = 2, gamma = 15, delta = 5)
temp\$cpt


[Package changepoints version 1.1.0 Index]