Title: | Sparse Distance Weighted Discrimination |
---|---|
Description: | Formulates a sparse distance weighted discrimination (SDWD) for high-dimensional classification and implements a very fast algorithm for computing its solution path with the L1, the elastic-net, and the adaptive elastic-net penalties. More details about the methodology SDWD is seen on Wang and Zou (2016) (<doi:10.1080/10618600.2015.1049700>). |
Authors: | Boxiang Wang and Hui Zou |
Maintainer: | Boxiang Wang <[email protected]> |
License: | GPL-2 |
Version: | 1.0.6 |
Built: | 2024-10-14 04:01:16 UTC |
Source: | https://github.com/boxiang-wang/sdwd |
This package implements the generalized coordinate descent (GCD) algorithm to efficiently compute the solution path of the sparse distance weighted discrimination (DWD) at a given fine grid of regularization parameters. Sparse distance weighted discrimination is a high-dimensional margin-based classifier.
Package: | sdwd |
Type: | Package |
Version: | 1.0.3 |
Date: | 2020-02-16 |
License: | GPL-2 |
Suppose x
is the predictors and y
is the binary response. With a fixed value lambda2
, the package produces the solution path of the sparse DWD over a grid of lambda
values. The value of lambda2
can be further tuned by cross-validation.
The package sdwd
contains five main functions:sdwd
cv.sdwd
coef.sdwd
plot.sdwd
plot.cv.sdwd
Boxiang Wang and Hui Zou
Maintainer: Boxiang Wang [email protected]
Wang, B. and Zou, H. (2016)
“Sparse Distance Weighted Discrimination", Journal of Computational and Graphical Statistics, 25(3), 826–838.
https://www.tandfonline.com/doi/full/10.1080/10618600.2015.1049700
Friedman, J., Hastie, T., and Tibshirani, R. (2010), "Regularization paths for generalized
linear models via coordinate descent," Journal of Statistical Software, 33(1), 1–22.
https://www.jstatsoft.org/v33/i01/paper
Marron, J.S., Todd, M.J., Ahn, J. (2007)
“Distance-Weighted Discrimination"",
Journal of the American Statistical Association, 102(408), 1267–1271.
https://www.tandfonline.com/doi/abs/10.1198/016214507000001120
Tibshirani, Robert., Bien, J., Friedman, J.,Hastie, T.,Simon,
N.,Taylor, J., and Tibshirani, Ryan. (2012)
Strong Rules for Discarding Predictors in Lasso-type Problems,
Journal of the Royal Statistical Society, Series B, 74(2), 245–266.
https://rss.onlinelibrary.wiley.com/doi/abs/10.1111/j.1467-9868.2011.01004.x
Yang, Y. and Zou, H. (2013)
“An Efficient Algorithm for Computing the HHSVM and Its Generalizations",
Journal of Computational and Graphical Statistics, 22(2), 396–415.
https://www.tandfonline.com/doi/full/10.1080/10618600.2012.680324
Computes coefficients at chosen values of lambda
from the cv.sdwd
object.
## S3 method for class 'cv.sdwd' coef(object, s=c("lambda.1se", "lambda.min"),...)
## S3 method for class 'cv.sdwd' coef(object, s=c("lambda.1se", "lambda.min"),...)
object |
A fitted |
s |
Value(s) of the L1 tuning parameter |
... |
Other arguments that can be passed to |
This function computes the coefficients at the values of lambda
suggested by the cross-validation. This function is modified based on the coef.cv
function from the glmnet
and the gcdnet
packages.
The returned object depends on the choice of s
and the ...
argument passed on to the sdwd
method.
Boxiang Wang and Hui Zou
Maintainer: Boxiang Wang [email protected]
Wang, B. and Zou, H. (2016)
“Sparse Distance Weighted Discrimination", Journal of Computational and Graphical Statistics, 25(3), 826–838.
https://www.tandfonline.com/doi/full/10.1080/10618600.2015.1049700
Yang, Y. and Zou, H. (2013)
“An Efficient Algorithm for Computing the HHSVM and Its Generalizations",
Journal of Computational and Graphical Statistics, 22(2), 396–415.
https://www.tandfonline.com/doi/full/10.1080/10618600.2012.680324
Friedman, J., Hastie, T., and Tibshirani, R. (2010), "Regularization paths for generalized
linear models via coordinate descent," Journal of Statistical Software, 33(1), 1–22.
https://www.jstatsoft.org/v33/i01/paper
cv.sdwd
and predict.cv.sdwd
methods.
data(colon) colon$x = colon$x[ , 1:100] # this example only uses the first 100 columns set.seed(1) cv = cv.sdwd(colon$x, colon$y, lambda2=1, nfolds=5) c1 = coef(cv, s="lambda.1se")
data(colon) colon$x = colon$x[ , 1:100] # this example only uses the first 100 columns set.seed(1) cv = cv.sdwd(colon$x, colon$y, lambda2=1, nfolds=5) c1 = coef(cv, s="lambda.1se")
Computes the coefficients or returns the indices of nonzero coefficients at chosen values of lambda
from a fitted sdwd
object.
## S3 method for class 'sdwd' coef(object, s=NULL, type=c("coefficients","nonzero"), ...)
## S3 method for class 'sdwd' coef(object, s=NULL, type=c("coefficients","nonzero"), ...)
object |
A fitted |
s |
Value(s) of the L1 tuning parameter |
type |
|
... |
Not used. Other arguments to |
s
is the new vector at which predictions are requested. If s
is not in the lambda sequence used for fitting the model, the coef
function will use linear interpolation to make predictions. The new values are interpolated using a fraction of coefficients from both left and right lambda
indices. This function is modified based on the coef
function from the gcdnet
and the glmnet
packages.
Either the coefficients at the requested values of lambda
, or a list of the indices of the nonzero coefficients for each lambda
.
Boxiang Wang and Hui Zou
Maintainer: Boxiang Wang [email protected]
Wang, B. and Zou, H. (2016)
“Sparse Distance Weighted Discrimination", Journal of Computational and Graphical Statistics, 25(3), 826–838.
https://www.tandfonline.com/doi/full/10.1080/10618600.2015.1049700
Yang, Y. and Zou, H. (2013)
“An Efficient Algorithm for Computing the HHSVM and Its Generalizations",
Journal of Computational and Graphical Statistics, 22(2), 396–415
https://www.tandfonline.com/doi/full/10.1080/10618600.2012.680324
Friedman, J., Hastie, T., and Tibshirani, R. (2010), "Regularization paths for generalized
linear models via coordinate descent," Journal of Statistical Software, 33(1), 1–22
https://www.jstatsoft.org/v33/i01/paper
data(colon) fit = sdwd(colon$x, colon$y, lambda2=1) c1 = coef(fit, type="coef",s=c(0.1, 0.005)) c2 = coef(fit, type="nonzero")
data(colon) fit = sdwd(colon$x, colon$y, lambda2=1) c1 = coef(fit, type="coef",s=c(0.1, 0.005)) c2 = coef(fit, type="nonzero")
Gene expression data (2000 genes for 62 samples) from a DNA microarray experiments of colon tissue samples (Alon et al., 1999).
data(colon)
data(colon)
This data set contains 62 colon tissue samples with 2000 gene expression levels. Among 62 samples, 40 are tumor tissues (coded 1) and 22 are normal tissues (coded -1).
A list with the following elements:
x |
A matrix of 2000 columns and 62 rows standing for 2000 gene expression levels and 62 colon tissue samples. Each row corresponds to a patient. |
y |
A numeric vector of length 62 representing the tissue type (1 for tumor; -1 for normal). |
The data were introduced in Alon et al. (1999).
Alon, U., Barkai, N., Notterman, D.A., Gish, K., Ybarra, S., Mack, D., and Levine, A.J. (1999).
“Broad patterns of gene expression revealed by clustering analysis of tumor and normal colon tissues probed by oligonucleotide arrays”,
Proceedings of the National Academy of Sciences, 96(12), 6745–6750.
# load sdwd library library(sdwd) # load data set data(colon) # how many samples and how many predictors? dim(colon$x) # how many samples of class -1 and 1 respectively? sum(colon$y == -1) sum(colon$y == 1)
# load sdwd library library(sdwd) # load data set data(colon) # how many samples and how many predictors? dim(colon$x) # how many samples of class -1 and 1 respectively? sum(colon$y == -1) sum(colon$y == 1)
Conducts a k-fold cross-validation for sdwd
and returns the suggested values of the L1 parameter lambda
.
cv.sdwd(x, y, lambda = NULL, pred.loss = c("misclass", "loss"), nfolds = 5, foldid, ...)
cv.sdwd(x, y, lambda = NULL, pred.loss = c("misclass", "loss"), nfolds = 5, foldid, ...)
x |
A matrix of predictors, i.e., the |
y |
A vector of binary class labels, i.e., the |
lambda |
Default is |
pred.loss |
|
nfolds |
The number of folds. Default value is 5. The allowable range is from 3 to the sample size. Larger |
foldid |
An optional vector with values between 1 and |
... |
Other arguments that can be passed to |
This function runs sdwd
to the sparse DWD by excluding every fold alternatively, and then computes the mean cross-validation error and the standard deviation. This function is modified based on the cv
function from the gcdnet
and the glmnet
packages.
A cv.sdwd
object is returned, which includes the cross-validation fit.
lambda |
The |
cvm |
A vector of length |
cvsd |
A vector of length |
cvupper |
The upper curve: |
cvlower |
The lower curve: |
nzero |
Numbers of non-zero coefficients at each |
name |
“Mis-classification error", for plotting purposes. |
sdwd.fit |
A fitted |
lambda.min |
The |
lambda.1se |
The largest value of |
cv.min |
The minimum cross-validation error. |
cv.1se |
The cross-validation error associated with |
Boxiang Wang and Hui Zou
Maintainer: Boxiang Wang [email protected]
Wang, B. and Zou, H. (2016)
“Sparse Distance Weighted Discrimination", Journal of Computational and Graphical Statistics, 25(3), 826–838.
https://www.tandfonline.com/doi/full/10.1080/10618600.2015.1049700
Yang, Y. and Zou, H. (2013)
“An Efficient Algorithm for Computing the HHSVM and Its Generalizations",
Journal of Computational and Graphical Statistics, 22(2), 396–415.
https://www.tandfonline.com/doi/full/10.1080/10618600.2012.680324
Friedman, J., Hastie, T., and Tibshirani, R. (2010), "Regularization paths for generalized
linear models via coordinate descent," Journal of Statistical Software, 33(1), 1–22.
https://www.jstatsoft.org/v33/i01/paper
sdwd
, plot.cv.sdwd
, predict.cv.sdwd
, and coef.cv.sdwd
methods.
data(colon) colon$x = colon$x[ , 1:100] # this example only uses the first 100 columns n = nrow(colon$x) set.seed(1) id = sample(n, trunc(n/3)) cvfit = cv.sdwd(colon$x[-id, ], colon$y[-id], lambda2=1, nfolds=5) plot(cvfit) predict(cvfit, newx=colon$x[id, ], s="lambda.min")
data(colon) colon$x = colon$x[ , 1:100] # this example only uses the first 100 columns n = nrow(colon$x) set.seed(1) id = sample(n, trunc(n/3)) cvfit = cv.sdwd(colon$x[-id, ], colon$y[-id], lambda2=1, nfolds=5) plot(cvfit) predict(cvfit, newx=colon$x[id, ], s="lambda.min")
Plots the cross-validation curve against a function of lambda
values. The function also provides the upper and lower standard deviation curves.
## S3 method for class 'cv.sdwd' plot(x, sign.lambda, ...)
## S3 method for class 'cv.sdwd' plot(x, sign.lambda, ...)
x |
A fitted |
sign.lambda |
Whether to plot against |
... |
Other graphical parameters to |
This function depicts the cross-validation curves. This function is modified based on the plot.cv
function from the glmnet
and the gcdnet
packages.
Boxiang Wang and Hui Zou
Maintainer: Boxiang Wang [email protected]
Wang, B. and Zou, H. (2016)
“Sparse Distance Weighted Discrimination", Journal of Computational and Graphical Statistics, 25(3), 826–838.
https://www.tandfonline.com/doi/full/10.1080/10618600.2015.1049700
Yang, Y. and Zou, H. (2013)
“An Efficient Algorithm for Computing the HHSVM and Its Generalizations",
Journal of Computational and Graphical Statistics, 22(2), 396–415.
https://www.tandfonline.com/doi/full/10.1080/10618600.2012.680324
Friedman, J., Hastie, T., and Tibshirani, R. (2010), "Regularization paths for generalized
linear models via coordinate descent," Journal of Statistical Software, 33(1), 1–22.
https://www.jstatsoft.org/v33/i01/paper
data(colon) colon$x = colon$x[ , 1:100] # this example only uses the first 100 columns set.seed(1) cv = cv.sdwd(colon$x, colon$y, lambda2=1, nfolds=5) plot(cv)
data(colon) colon$x = colon$x[ , 1:100] # this example only uses the first 100 columns set.seed(1) cv = cv.sdwd(colon$x, colon$y, lambda2=1, nfolds=5) plot(cv)
Plots the solution paths for a fitted sdwd
object.
## S3 method for class 'sdwd' plot(x, xvar=c("norm", "lambda"), color=FALSE, label=FALSE, ...)
## S3 method for class 'sdwd' plot(x, xvar=c("norm", "lambda"), color=FALSE, label=FALSE, ...)
x |
A fitted |
xvar |
Specifies the X-axis. If |
color |
If |
label |
If |
... |
Other graphical parameters to |
Plots the solution paths as a coefficient profile plot. This function is modified based on the plot
function from the gcdnet
and the glmnet
packages.
Boxiang Wang and Hui Zou
Maintainer: Boxiang Wang [email protected]
Wang, B. and Zou, H. (2016)
“Sparse Distance Weighted Discrimination", Journal of Computational and Graphical Statistics, 25(3), 826–838.
https://www.tandfonline.com/doi/full/10.1080/10618600.2015.1049700
Yang, Y. and Zou, H. (2013)
“An Efficient Algorithm for Computing the HHSVM and Its Generalizations",
Journal of Computational and Graphical Statistics, 22(2), 396–415.
https://www.tandfonline.com/doi/full/10.1080/10618600.2012.680324
Friedman, J., Hastie, T., and Tibshirani, R. (2010), "Regularization paths for generalized
linear models via coordinate descent," Journal of Statistical Software, 33(1), 1–22.
https://www.jstatsoft.org/v33/i01/paper
print.sdwd
, predict.sdwd
, coef.sdwd
, plot.sdwd
, and cv.sdwd
.
data(colon) fit = sdwd(colon$x, colon$y) par(mfrow=c(1,3)) # plots against the L1-norm of the coefficients plot(fit) # plots against the log-lambda sequence plot(fit, xvar="lambda", label=TRUE) # plots with colors plot(fit, color=TRUE)
data(colon) fit = sdwd(colon$x, colon$y) par(mfrow=c(1,3)) # plots against the L1-norm of the coefficients plot(fit) # plots against the log-lambda sequence plot(fit, xvar="lambda", label=TRUE) # plots with colors plot(fit, color=TRUE)
This function predicts the class labels of new observations by the sparse DWD at the lambda
values suggested by cv.sdwd
.
## S3 method for class 'cv.sdwd' predict(object, newx, s=c("lambda.1se","lambda.min"),...)
## S3 method for class 'cv.sdwd' predict(object, newx, s=c("lambda.1se","lambda.min"),...)
object |
A fitted |
newx |
A matrix of new values for |
s |
Value(s) of the L1 tuning parameter |
... |
Not used. Other arguments to |
This function uses the cross-validation results to making predictions. This function is modified based on the predict.cv
function from the glmnet
and the gcdnet
packages.
Predicted class labels or fitted values, depending on the choice of s
and the ... argument passed on to the sdwd
method.
Boxiang Wang and Hui Zou
Maintainer: Boxiang Wang [email protected]
Wang, B. and Zou, H. (2016)
“Sparse Distance Weighted Discrimination", Journal of Computational and Graphical Statistics, 25(3), 826–838.
https://www.tandfonline.com/doi/full/10.1080/10618600.2015.1049700
Yang, Y. and Zou, H. (2013)
“An Efficient Algorithm for Computing the HHSVM and Its Generalizations",
Journal of Computational and Graphical Statistics, 22(2), 396–415.
https://www.tandfonline.com/doi/full/10.1080/10618600.2012.680324
Friedman, J., Hastie, T., and Tibshirani, R. (2010), "Regularization paths for generalized
linear models via coordinate descent," Journal of Statistical Software, 33(1), 1–22.
https://www.jstatsoft.org/v33/i01/paper
cv.sdwd
, and coef.cv.sdwd
methods.
data(colon) colon$x = colon$x[ , 1:100] # this example only uses the first 100 columns set.seed(1) cv = cv.sdwd(colon$x, colon$y, lambda2=1, nfolds=5) predict(cv$sdwd.fit, newx=colon$x[2:5, ], s=cv$lambda.1se, type="class")
data(colon) colon$x = colon$x[ , 1:100] # this example only uses the first 100 columns set.seed(1) cv = cv.sdwd(colon$x, colon$y, lambda2=1, nfolds=5) predict(cv$sdwd.fit, newx=colon$x[2:5, ], s=cv$lambda.1se, type="class")
This function predicts the binary class labels or the fitted values of an sdwd
object.
## S3 method for class 'sdwd' predict(object, newx, s=NULL, type=c("class", "link"), ...)
## S3 method for class 'sdwd' predict(object, newx, s=NULL, type=c("class", "link"), ...)
object |
A fitted |
newx |
A matrix of new values for |
s |
Value(s) of the L1 tuning parameter |
type |
|
... |
Not used. Other arguments to |
s
stands for the new lambda
values for making predictions. If s
is not in the original lambda
sequence generated by sdwd
, the predict.sdwd
function will use linear interpolation by using a fraction of predicted values from the lambda
values in the original sequence adjacent to the s
to make predictions. The predict.sdwd
function is modified based on the predict
function from the glmnet
and the gcdnet
packages.
Returns either the predicted class labels or the fitted values, depending on the choice of type
.
Boxiang Wang and Hui Zou
Maintainer: Boxiang Wang [email protected]
Wang, B. and Zou, H. (2016)
“Sparse Distance Weighted Discrimination", Journal of Computational and Graphical Statistics, 25(3), 826–838.
https://www.tandfonline.com/doi/full/10.1080/10618600.2015.1049700
Yang, Y. and Zou, H. (2013)
“An Efficient Algorithm for Computing the HHSVM and Its Generalizations",
Journal of Computational and Graphical Statistics, 22(2), 396–415.
https://www.tandfonline.com/doi/full/10.1080/10618600.2012.680324
Friedman, J., Hastie, T., and Tibshirani, R. (2010), "Regularization paths for generalized
linear models via coordinate descent," Journal of Statistical Software, 33(1), 1–22.
https://www.jstatsoft.org/v33/i01/paper
data(colon) fit = sdwd(colon$x, colon$y, lambda2=1) print(predict(fit ,type="class",newx=colon$x[2:5,]))
data(colon) fit = sdwd(colon$x, colon$y, lambda2=1) print(predict(fit ,type="class",newx=colon$x[2:5,]))
Print a summary of the sdwd
solution paths.
## S3 method for class 'sdwd' print(x, digits=max(3, getOption("digits") - 3), ...)
## S3 method for class 'sdwd' print(x, digits=max(3, getOption("digits") - 3), ...)
x |
A fitted |
digits |
Specify the significant digits. |
... |
Additional print arguments. |
This function prints a two-column matrix with columns Df
and Lambda
, where the Df
column exhibits the number of nonzero coefficients and the Lambda
column displays the corresponding lambda
value. This function is modified based on the print
function from the gcdnet
and the glmnet
packages.
A two-column matrix with one column of the number of nonzero coefficients and a second column of lambda
values.
Boxiang Wang and Hui Zou
Maintainer: Boxiang Wang [email protected]
Wang, B. and Zou, H. (2016)
“Sparse Distance Weighted Discrimination", Journal of Computational and Graphical Statistics, 25(3), 826–838.
https://www.tandfonline.com/doi/full/10.1080/10618600.2015.1049700
Yang, Y. and Zou, H. (2013)
“An Efficient Algorithm for Computing the HHSVM and Its Generalizations",
Journal of Computational and Graphical Statistics, 22(2), 396–415.
https://www.tandfonline.com/doi/full/10.1080/10618600.2012.680324
Friedman, J., Hastie, T., and Tibshirani, R. (2010), "Regularization paths for generalized
linear models via coordinate descent," Journal of Statistical Software, 33(1), 1–22.
https://www.jstatsoft.org/v33/i01/paper
print.sdwd
, predict.sdwd
, coef.sdwd
, plot.sdwd
, and cv.sdwd
.
data(colon) fit = sdwd(colon$x, colon$y) print(fit)
data(colon) fit = sdwd(colon$x, colon$y) print(fit)
Fits the sparse distance weighted discrimination (SDWD) model with imposing L1, elastic-net, or adaptive elastic-net penalties. The solution path is computed at a grid of values of tuning parameter lambda
. This function is modified based on the glmnet
and the gcdnet
packages.
sdwd(x, y, nlambda=100, lambda.factor=ifelse(nobs < nvars, 0.01, 1e-04), lambda=NULL, lambda2=0, pf=rep(1, nvars), pf2=rep(1, nvars), exclude, dfmax=nvars + 1, pmax=min(dfmax * 1.2, nvars), standardize=TRUE, eps=1e-8, maxit=1e6, strong=TRUE)
sdwd(x, y, nlambda=100, lambda.factor=ifelse(nobs < nvars, 0.01, 1e-04), lambda=NULL, lambda2=0, pf=rep(1, nvars), pf2=rep(1, nvars), exclude, dfmax=nvars + 1, pmax=min(dfmax * 1.2, nvars), standardize=TRUE, eps=1e-8, maxit=1e6, strong=TRUE)
x |
A matrix with |
y |
A vector of length |
nlambda |
The number of |
lambda.factor |
The ratio of the smallest to the largest |
lambda |
An optional user-supplied |
lambda2 |
The L2 tuning parameter |
pf |
A vector of length |
pf2 |
A vector of length |
exclude |
Whether to exclude some predictors from the model. This is equivalent to adopting an infinite penalty factor when excluding some predictor. Default is none. |
dfmax |
Restricts at most how many predictors can be incorporated in the model. Default is |
pmax |
Restricts the maximum number of variables ever to be nonzero; e.g, once some |
standardize |
Whether to standardize the data. If |
eps |
The algorithm stops when (i.e. |
maxit |
Restricts how many outer-loop iterations are allowed. Default is 1e6. Consider increasing |
strong |
If |
The sdwd
minimizes the sparse penalized DWD loss function,
where if
,
if
is the DWD loss. The value of
lambda2
is user-specified.
To use the L1 penalty (lasso), set lambda2=0
. To use the elastic net, set lambda2
as nonzero. To use the adaptive L1, set lambda2=0
and specify pf
and pf2
. To use the adaptive elastic net, set lambda2
as nonzero and specify pf
and pf2
as well.
When the algorithm do not converge or run slow, consider increasing eps
, decreasing
nlambda
, or increasing lambda.factor
before increasing
maxit
.
An object with S3 class sdwd
.
b0 |
A vector of length |
beta |
A matrix of dimension |
df |
The number of nonzero coefficients at each |
dim |
The dimension of coefficient matrix, i.e., |
lambda |
The |
npasses |
Total number of iterations for all lambda values. |
jerr |
Warnings and errors; 0 if no error. |
call |
The call that produced this object. |
Boxiang Wang and Hui Zou
Maintainer: Boxiang Wang [email protected]
Wang, B. and Zou, H. (2016)
“Sparse Distance Weighted Discrimination", Journal of Computational and Graphical Statistics, 25(3), 826–838.
https://www.tandfonline.com/doi/full/10.1080/10618600.2015.1049700
Friedman, J., Hastie, T., and Tibshirani, R. (2010), "Regularization paths for generalized
linear models via coordinate descent", Journal of Statistical Software, 33(1), 1–22.
https://www.jstatsoft.org/v33/i01/paper
Marron, J.S., Todd, M.J., and Ahn, J. (2007)
“Distance-Weighted Discrimination",
Journal of the American Statistical Association, 102(408), 1267–1271.
https://www.tandfonline.com/doi/abs/10.1198/016214507000001120
Tibshirani, Robert., Bien, J., Friedman, J.,Hastie, T.,Simon,
N.,Taylor, J., and Tibshirani, Ryan. (2012)
Strong Rules for Discarding Predictors in Lasso-type Problems,
Journal of the Royal Statistical Society, Series B, 74(2), 245–266.
https://rss.onlinelibrary.wiley.com/doi/abs/10.1111/j.1467-9868.2011.01004.x
Yang, Y. and Zou, H. (2013)
“An Efficient Algorithm for Computing the HHSVM and Its Generalizations",
Journal of Computational and Graphical Statistics, 22(2), 396–415.
https://www.tandfonline.com/doi/full/10.1080/10618600.2012.680324
print.sdwd
, predict.sdwd
, coef.sdwd
, plot.sdwd
, and cv.sdwd
.
# load the data data(colon) # fit the elastic-net penalized DWD with lambda2=1 fit = sdwd(colon$x, colon$y, lambda2=1) print(fit) # coefficients at some lambda value c1 = coef(fit, s=0.005) # make predictions predict(fit, newx=colon$x[1:10, ], s=c(0.01, 0.005))
# load the data data(colon) # fit the elastic-net penalized DWD with lambda2=1 fit = sdwd(colon$x, colon$y, lambda2=1) print(fit) # coefficients at some lambda value c1 = coef(fit, s=0.005) # make predictions predict(fit, newx=colon$x[1:10, ], s=c(0.01, 0.005))