powered by
the function carries out the Lasso regression using fixed step using FISTA algorithm.
lasso_fista(data,y,x,lambda,max_step=10000,type="Gaussian",image=TRUE,ini=0.5,tol=10^-7)
A list containing:
coefficients: A matrix where each column represents the estimated regression coefficients for a different lambda value.
coefficients
error_evolution: A numeric vector tracking the error at certain step.
error_evolution
num_steps: An integer vector indicating the number of steps in which errors are calculated.
num_steps
name of the dataset
name of the dependent variables
name of the independent variable
a vector of lambda-value to be evaluated in the regression
maximum number of steps
type of response variable, by default, it is 'Gaussian' for continuos response and can be modified as 'Binomial' for binary response
logical, if TRUE, the evolution of errors in term of lambda values will be plotted
initial value for the coefficients
tolerance for convergence, it is 10^-7 by default
lasso_fista
library("glmnet") data("QuickStartExample") test<-as.data.frame(cbind(QuickStartExample$y,QuickStartExample$x)) lasso_fista(test,"V1",colnames(test)[2:21],lambda=0.1,image=TRUE,max_step=1000)
Run the code above in your browser using DataLab