View source: R/wrap-highdim2.R
| hdreg_wrapper | R Documentation |
Wraps changepoints::CV.search.DP.regression() (Rinaldo, Wang, Wen,
Willett and Yu): dynamic programming with an \ell_0 penalty for
changes in the coefficient vector of a high-dimensional sparse regression,
with the two tuning parameters chosen by cross-validation. Where
strucchange_wrapper() dates breaks in a low-dimensional
regression by dynamic programming on the residual sum of squares, this
handles the case where there are more covariates than the segments have
observations to fit them with.
hdreg_wrapper(
x,
response = NULL,
gamma_set = NULL,
lambda_set = NULL,
delta = NULL,
...
)
x |
A numeric matrix or data frame of covariates, rows as time points. |
response |
A numeric vector of responses, one per row of |
gamma_set |
Candidate values of the |
lambda_set |
Candidate lasso penalties. Defaults to
|
delta |
Minimum spacing. Defaults to |
... |
Additional arguments passed to the engine. |
A ggcpt object with change_in = "regression". The
plotted series is the response, which is what a reader of a
regression-break plot expects to see.
rinaldo2021hdregggchangepoint
var_wrapper(), strucchange_wrapper().
Other changepoint engines:
bcp_wrapper(),
beast_wrapper(),
bfast_wrapper(),
binsegrcpp_wrapper(),
bocpd_wrapper(),
capa_wrapper(),
cpm_wrapper(),
cpop_wrapper(),
cpt_wrapper(),
decafs_wrapper(),
ecp_wrapper(),
envcpt_wrapper(),
esac_wrapper(),
fabisearch_wrapper(),
fastcpd_wrapper(),
fcov_wrapper(),
fmean_wrapper(),
fpop_wrapper(),
geomcp_wrapper(),
hdcov_wrapper(),
idetect_wrapper(),
inspect_wrapper(),
kcp_wrapper(),
kwc_wrapper(),
mcp_wrapper(),
mosum_wrapper(),
network_wrapper(),
not_wrapper(),
npmojo_wrapper(),
nsp_wrapper(),
ocd_wrapper(),
pilliat_wrapper(),
segmented_wrapper(),
smuce_wrapper(),
sn_wrapper(),
strucchange_wrapper(),
taylor_wrapper(),
tguh_wrapper(),
trend_wrapper(),
var_wrapper(),
wbs2_wrapper(),
wbs_wrapper(),
wbsts_wrapper()
set.seed(2026)
p <- 10
n <- 80
X <- matrix(stats::rnorm(n * p), n, p)
beta1 <- c(rep(2, 3), rep(0, p - 3))
beta2 <- c(rep(0, p - 3), rep(2, 3))
y <- c(X[1:40, ] %*% beta1, X[41:n, ] %*% beta2) + stats::rnorm(n)
hdreg_wrapper(X, response = y, gamma_set = c(1, 10),
lambda_set = c(0.1, 1))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.