Package 'DLASSO'

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-09-02 03:07:40 UTC
Source: https://github.com/cran/DLASSO

Help Index


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 <[email protected]>

See Also

dlasso,plot.dlasso

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 λ.max\lambda.max and λ.min\lambda.min.

split

The number of splits between λ.min\lambda.min and λ.max\lambda.max.

maxIter

The maximum iterations for the algorithm. Default is 500.

adj

Positive value. This value adjusts the upper value for the penalty term, adjλ.maxadj*\lambda.max.

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 <[email protected]>

See Also

coef.dlasso,plot.dlasso

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 <[email protected]>

See Also

dlasso,coef.dlasso

Examples

example(dlasso)