lasso_ista_back: Lasso regression with backtraking line research

View source: R/models.R

lasso_ista_backR Documentation

Lasso regression with backtraking line research

Description

the function carries out the Lasso regression using backtraking line research and ISTA algorithm.

Usage

lasso_ista_back(data,y,x,lambda,max_step=10000,tol=10^-7,
type="Gaussian",ini=0.5,image=TRUE)

Arguments

data

name of the dataset

y

name of the dependent variables

x

name of the independent variable

lambda

a vector of lambda-value to be evaluated in the regression

max_step

maximum number of steps

tol

tolerance for convergence, it is 10^-7 by default

type

type of response variable, by default, it is 'Gaussian' for continuos response and can be modified as 'Binomial' for binary response

ini

initial value for the coefficients,dafault is 0.5

image

plots the evolution of errors in term of lambda values

Details

lasso_ista_back

Value

A list containing:

  • coefficients: A matrix where each column represents the estimated regression coefficients for a different lambda value.

  • error_evolution: A numeric vector tracking the error at certain step.

  • num_steps: An integer vector indicating the number of steps in which errors are calculated.

Examples

library("glmnet")
data("QuickStartExample")
test<-as.data.frame(cbind(QuickStartExample$y,QuickStartExample$x))
lasso_ista_back(test,"V1",colnames(test)[2:21],lambda=0.1,image=TRUE,type='Gaussian',max_step=100)

ProxReg documentation built on April 3, 2025, 9:21 p.m.