compute_gauss_lasso: Do a lm on top of a lasso regression.

compute_gauss_lassoR Documentation

Do a lm on top of a lasso regression.

Description

compute_gauss_lasso takes the variables selected by a lasso procedure, and uses them to do a simple linear least square regression. Function used is lm for non-transformed data (root = NULL), and lm.fit for transformed data (root = an integer).

Usage

compute_gauss_lasso(
  Ypt,
  Xp,
  delta,
  root,
  projection = which(rowSums(delta) != 0)
)

Arguments

Xp

(transformed) matrix of regression

delta

regression coefficients obtained with a lasso regression

root

the position of the root (intercept) in delta

Yp

(transformed) data

Details

Depending on the value of root, the behavior is different. If root is null, then we fit a linear regression with an intercept. If root is equal to an integer, then the "intercept" column of the matrix Xp (that has possibly been trough a multiplication with a Cholesky decomposition of the variance) is included, rather than the intercept.

Value

Named list, with "E0.gauss" the intercept (value at the root); "shifts.gauss" the list of shifts found on the branches; and "residuals" the residuals of the regression


PhylogeneticEM documentation built on Aug. 31, 2022, 9:16 a.m.