data(Prostate)
X <- cbind(1, Prostate$X)
xtx <- apply(X, 2, crossprod) / nrow(X)
y <- Prostate$y
X.bm <- as.big.matrix(X)
init <- rep(0, ncol(X))
fit <- biglasso_path(
X = X.bm, y = y, r = y, init = init, xtx = xtx,
lambda = c(0.5, 0.1, 0.05, 0.01, 0.001),
penalty.factor = c(0, rep(1, ncol(X) - 1)), max.iter = 2000
)
fit$beta
fit <- biglasso_path(
X = X.bm, y = y, r = y, init = init, xtx = xtx,
lambda = c(0.5, 0.1, 0.05, 0.01, 0.001), penalty = "MCP",
penalty.factor = c(0, rep(1, ncol(X) - 1)), max.iter = 2000
)
fit$beta
Run the code above in your browser using DataLab