cov_lasso: Fit a linear regression model using a covariance matrix

Description Usage Arguments Value Examples

View source: R/lasso.R

Description

Fit a linear regression model using a covariance matrix

Usage

1
2
3
4
5
cov_lasso(Gamma, gamma, lambda.min.ratio = 1e-04, nlambda = 100,
  lambda = NULL, delta = 0, alpha = NULL, R = NULL,
  funcR = function(G) {     abs(G)^2 }, maxit = 10000, eps = 1e-04,
  warm = "lambda", init.beta = NULL, strong = TRUE, sparse = FALSE,
  impl = "cpp", abs = TRUE)

Arguments

Gamma

covariance matrix of explanatory variables

gamma

covariance vector of explanatory and objective variables

lambda.min.ratio

ratio of max lambda and min lambda

nlambda

the number of lambda (ignored if lambda is specified)

lambda

lambda sequence

delta

ratio of regularization (exclusive penalty / l1 penalty) (default: 0)

alpha

mixing parameter of regularization of l1 and exclusive penalty terms (delta = (1 - alpha) / alpha)

R

matrix using exclusive penalty term

funcR

function of R (input: X, output: R)

maxit

max iteration (default: 1e+4)

eps

convergence threshold for optimization (default: 1e-4)

warm

warm start direction: "lambda" (default) or "delta"

init.beta

initial values of beta

strong

whether use strong screening (default) or not

sparse

whether use sparse matrix or not (default)

impl

implementation language of optimization: "cpp" (default) or "r"

abs

(experimental) whether use absolute value of beta (default) or not

Value

lasso model

beta_standard

standardized coefficients

lambda

regularization parameters

alpha

alpha defined above

delta

delta defined above

Examples

1
2
3
4
5
6
7
X <- matrix(c(1,2,3,5,4,7,6,8,9,10), nrow=5, ncol=2)
b <- matrix(c(-1,1), nrow=2, ncol=1)
e <- matrix(c(0,-0.1,0.1,-0.1,0.1), nrow=5, ncol=1)
y <- as.numeric(X %*% b + e)
fit <- lasso(X, y)
pr <- predict_lasso(fit, X)
plot_lasso(fit)

Example output



iilasso documentation built on May 2, 2019, 10:14 a.m.