powered by
This function computes initial values for intercept parameter by solving a ridge regression problem.
INIT(Y, X, lam_ridge)
A numeric vector of length \(n\), representing the initial estimation for intercept parameter.
The response vector of length \(n\).
The design matrix of size \(n\times p\).
The tuning parameter for ridge regression.
n <- 100 p <- 100 beta <- rep(1,p) X <- matrix(rnorm(100*100), n, p) Y <- sample(c(-3,3),n,replace=TRUE,prob=c(1/2,1/2)) + X%*%beta lam_ridge <- 0.1 alpha_init <- INIT(Y, X, lam_ridge)
Run the code above in your browser using DataLab