DP.regression {changepoints}R Documentation

Dynamic programming algorithm for regression change points localisation with l_0 penalisation.

Description

Perform dynamic programming algorithm for regression change points localisation.

Usage

DP.regression(y, X, gamma, lambda, delta, eps = 0.001)

Arguments

y

A numeric vector of response variable.

X

A numeric matrix of covariates with vertical axis being time.

gamma

A positive numeric scalar stands for tuning parameter associated with l_0 penalty.

lambda

A positive numeric scalar stands for tuning parameter associated with the lasso penalty.

delta

A positive integer scalar stands for minimum spacing.

eps

A numeric scalar of precision level for convergence of lasso.

Value

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

partition

A vector of the best partition.

cpt

A vector of change points estimation.

Author(s)

Daren Wang & Haotian Xu

References

Rinaldo, Wang, Wen, Willett and Yu (2020) <arxiv:2010.10410>

Examples

d0 = 10
p = 20
n = 100
cpt_true = c(30, 70)
data = simu.change.regression(d0, cpt_true, p, n, sigma = 1, kappa = 9)
temp = DP.regression(y = data$y, X = data$X, gamma = 2, lambda = 1, delta = 5)
cpt_hat = temp$cpt

[Package changepoints version 1.1.0 Index]