lasso_regression_K_fixed
does the following regression :
||Yp-Xp.delta|| + lambda |delta|_1 using the function glmnet::glmnet
of
package glmnet
, where delta is a vector representing the shifts
occurring on the branches. It does a Gauss lasso regression using function
lm
on top of it. This function is used in functions
init.EM.lasso
, segmentation.OU.specialCase.lasso
, ...
lasso_regression_K_fixed.glmnet_multivariate(
Yp,
Xp,
K,
root = NULL,
penscale = rep(1, ncol(Xp)),
K_lag = 0
)
E0.gauss the intercept (value at the root)
shifts.gauss the list of shifts found on the branches
(transformed) data
(transformed) matrix of regression
number of non-zero components allowed
lambda is chosen so that delta has the right number of non zero components. If not possible, either temporarily raise the number of shifts and then select only the shifts with the highest modulus, or if not possible, throw an error.