Type: | Package |
Title: | Implementation of Adaptive or Non-Adaptive Differentiable Lasso and SCAD Penalties in Linear Models |
Version: | 2.0.2 |
Author: | Hamed Haseli Mashhadi <hamedhaseli@gmail.com> |
Maintainer: | Hamed Haseli Mashhadi <hamedhaseli@gmail.com> |
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. |
Depends: | R (≥ 2.0) |
License: | GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] |
Packaged: | 2017-06-08 12:10:30 UTC; hamedhm |
URL: | http://hamedhaseli.webs.com |
NeedsCompilation: | no |
Repository: | CRAN |
Imports: | MASS |
Date/Publication: | 2017-06-08 12:35:22 UTC |
Extract coefficients from a fitted dlasso model
Description
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.
Usage
## S3 method for class 'dlasso'
coef(object , ...)
Arguments
object |
dlasso object. |
... |
Not working. |
Value
A matrix of extracted coefficients.
Author(s)
Hamed Haselimashhadi <hamedhaseli@gmail.com>
See Also
Examples
example(dlasso)
An implementation of dlasso using iterative ridge algorithm
Description
This function allows implementing differentiable lasso (dlasso) for arbitrary values of \lambda
and s.
Usage
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)
Arguments
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. |
Value
A "dlasso" object of the form of a matrix ( \lambda
| s | AICc | GIC | BIC | GCV | estimations).
Author(s)
Hamed Haselimashhadi <hamedhaseli@gmail.com>
See Also
Examples
# 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)
Plot method for dlasso objects
Description
Produce a plot from a dlasso fit.
Usage
## S3 method for class 'dlasso'
plot(x, label=FALSE , cex.lab=1 , all=TRUE ,...)
Arguments
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. |
Author(s)
Hamed Haselimashhadi <hamedhaseli@gmail.com>
See Also
Examples
example(dlasso)