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
occuring 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)
(transformed) data
(transformed) matrix of regression
number of non-zero components allowed
E0.gauss the intercept (value at the root)
shifts.gauss the list of shifts found on the branches
lambda is choosen so that delta has the right number of non zero components. If not possible, either temporaly raise the number of shifts and then select only the shifts with the highest modulus, or if not possible, throw an error.