Learn R Programming

SILFS (version 0.1.0)

INIT: Initialization Function for the Intercept Parameter

Description

This function computes initial values for intercept parameter by solving a ridge regression problem.

Usage

INIT(Y, X, lam_ridge)

Value

A numeric vector of length \(n\), representing the initial estimation for intercept parameter.

Arguments

Y

The response vector of length \(n\).

X

The design matrix of size \(n\times p\).

lam_ridge

The tuning parameter for ridge regression.

Examples

Run this code
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