estRidge: Estimate Coefficients for Ridge Regression

Description Usage Arguments Details Author(s) See Also

View source: R/functions_ridge.R

Description

Computes a vector of regression coefficients for a provided ridge penalty.

Usage

1
estRidge(lambda, X, y, penalize, XtX = crossprod(X))

Arguments

lambda

ridge penalty factor

X

design matrix for the regression.

y

outcome vector. Unless X contains an intercept column, this should typically be centered.

penalize

vector giving penalty structure. Values must be in [0, 1]. See Details for more information.

XtX

(optional) cross product of the design matrix. If running simulations or other procedure for identical X, providing a pre-computed value can reduce computational cost.

Details

The input penalize is a vector of ridge penalty factors, such that the penalty for covariate j is lambda*penalize[j]. Although its primary purpose is for indicating which variables to penalize (1) and which to not penalize (0), fractional values between 0 and 1 are accepted. Defaults to c(0, rep(1, p-1)), where p is number of columns in X (this penalizes all coefficients but the first).

The design matrix X is assumed to contain only numeric values, so any factors should be coded according to desired contrast (e.g., via model.matrix)

Author(s)

Joshua Keller

See Also

festRidge, mseRidge


eshrink documentation built on Jan. 13, 2021, 6:59 a.m.