local.refine.regression {changepoints}R Documentation

Local refinement for regression change points localisation.

Description

Perform local refinement for regression change points localisation.

Usage

local.refine.regression(cpt_init, y, X, zeta)

Arguments

cpt_init

An integer vector of initial changepoints estimation (sorted in strictly increasing order).

y

A numeric vector of response variable.

X

A numeric matrix of covariates with vertical axis being time..

zeta

A numeric scalar of tuning parameter for the group lasso.

Value

A vector of locally refined change points estimation.

Author(s)

Daren Wang & Haotian Xu

References

Rinaldo, A., Wang, D., Wen, Q., Willett, R., & Yu, Y. (2021, March). Localizing changes in high-dimensional regression models. In International Conference on Artificial Intelligence and Statistics (pp. 2089-2097). PMLR.

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)
gamma_set = c(0.01, 0.1, 1)
lambda_set = c(0.01, 0.1, 1, 3)
temp = CV.search.DP.regression(y = data$y, X = data$X, gamma_set, lambda_set, delta = 2)
temp$test_error # test error result
# find the indices of gamma_set and lambda_set which minimizes the test error
min_idx = as.vector(arrayInd(which.min(temp$test_error), dim(temp$test_error)))
gamma_set[min_idx[1]]
lambda_set[min_idx[2]]
cpt_init = unlist(temp$cpt_hat[min_idx[1], min_idx[2]])
local.refine.regression(cpt_init, data$y, X = data$X, zeta = 0.5)

[Package changepoints version 1.1.0 Index]