Title: | Implementation of Adaptive or Non-Adaptive Differentiable Lasso and SCAD Penalties in Linear Models |
---|---|
Description: | An implementation of the differentiable lasso (dlasso) and SCAD (dSCAD) using iterative ridge algorithm. This package allows selecting the tuning parameter by AIC, BIC, GIC and GIC. |
Authors: | Hamed Haseli Mashhadi <[email protected]> |
Maintainer: | Hamed Haseli Mashhadi <[email protected]> |
License: | GPL (>= 2) |
Version: | 2.0.2 |
Built: | 2024-11-01 03:07:42 UTC |
Source: | https://github.com/cran/DLASSO |
While dlasso() produces the entire path of solutions, coef.dlasso extracts a particular point along the path corresponded to the minimum AIC, BIC, GIC or GCV.
## S3 method for class 'dlasso' coef(object , ...)
## S3 method for class 'dlasso' coef(object , ...)
object |
dlasso object. |
... |
Not working. |
A matrix of extracted coefficients.
Hamed Haselimashhadi <[email protected]>
example(dlasso)
example(dlasso)
This function allows implementing differentiable lasso (dlasso) for arbitrary values of and s.
dlasso (x, y, s = 1 , intercept = FALSE , c = 1 , adp = TRUE , lambda = NULL , split = 50 , maxIter = 500 , adj = 1.1 , lowlambda = 10^-3 , digit = 5 , cauchy = FALSE , force = 'auto' , trace = FALSE)
dlasso (x, y, s = 1 , intercept = FALSE , c = 1 , adp = TRUE , lambda = NULL , split = 50 , maxIter = 500 , adj = 1.1 , lowlambda = 10^-3 , digit = 5 , cauchy = FALSE , force = 'auto' , trace = FALSE)
x |
Matrix of predictors |
y |
Response vector |
s |
A single or a vector of precision value, s, given adp=FALSE. Default is 1. See "adp" parameter. |
intercept |
Logical flag. If TRUE, an intercept is included in the model, otherwise no intercept is included. Default is FALSE. |
c |
Choose between dlasso (c=1) and dSCAD (c=-1). Default is dlasso. See futher "force" parameter. |
adp |
Logical flag. TRUE to use adaptive adjustment for s. If TRUE then the function ignores the initial s. |
lambda |
Optional values for the tuning parameter. A single value or a sequence of values. Useful for manually searching over user defined set of tuning values. Set to any negative value to activate the automatic setting for |
split |
The number of splits between |
maxIter |
The maximum iterations for the algorithm. Default is 500. |
adj |
Positive value. This value adjusts the upper value for the penalty term, |
lowlambda |
The lower limit for the tuning parameter. Default is 10^-3. |
digit |
The maximum number of digits before setting an estimation to zero. The default is 5 digits. |
cauchy |
Logical flag. Set to TRUE to use Cauchy CDF instead of Gaussian one in the penalty function. The default is Gaussian. |
force |
Logical flag. Set to TRUE to let only a decrease in absolute estimation of the parameters. Default is 'auto' that is only applied if sqrt(n)>2*log(p) for n the number of observations and p the number of parameters. |
trace |
Logical flag. If TRUE, output contains some information about the steps. Default is FALSE. |
A "dlasso" object of the form of a matrix ( | s | AICc | GIC | BIC | GCV | estimations).
Hamed Haselimashhadi <[email protected]>
# dLASSO r = 5 zr= 95 n = 50 b = c(1:r,rep(0,zr)) x = matrix(rnorm((r+zr)*n),ncol=r+zr) y = x %*% b +rnorm(n) dLasso = dlasso(x=x,y=y,adp=TRUE) plot(dLasso,label=.1,cex=.80,all = 1) coef(dLasso) # dSCAD dscad = dlasso(x=x,y=y,c=-1,adj=50) plot(dscad,label=.1,cex=.80,all = 1) coef(dscad)
# dLASSO r = 5 zr= 95 n = 50 b = c(1:r,rep(0,zr)) x = matrix(rnorm((r+zr)*n),ncol=r+zr) y = x %*% b +rnorm(n) dLasso = dlasso(x=x,y=y,adp=TRUE) plot(dLasso,label=.1,cex=.80,all = 1) coef(dLasso) # dSCAD dscad = dlasso(x=x,y=y,c=-1,adj=50) plot(dscad,label=.1,cex=.80,all = 1) coef(dscad)
Produce a plot from a dlasso fit.
## S3 method for class 'dlasso' plot(x, label=FALSE , cex.lab=1 , all=TRUE ,...)
## S3 method for class 'dlasso' plot(x, label=FALSE , cex.lab=1 , all=TRUE ,...)
x |
dlasso object |
label |
Show covariate labels on the right hand side of the plot. |
cex.lab |
See "cex.lab" in "par" function. |
all |
Logical flag. If TRUE shows all plots including AIC, GIC, BIC, CGV and complete coefficient path. Otherwise the output is a single plot for coefficient path. Default is TRUE. |
... |
Additional arguments for generic plot. |
Hamed Haselimashhadi <[email protected]>
example(dlasso)
example(dlasso)