View source: R/HD_regression.R
local.refine.regression | R Documentation |
Perform local refinement for regression change points localisation.
local.refine.regression(cpt_init, y, X, zeta)
cpt_init |
An |
y |
A |
X |
A |
zeta |
A |
A vector of locally refined change points estimation.
Daren Wang & Haotian Xu
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>
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.