ridgeGLMdof {porridge} | R Documentation |
Degrees of freedom of the generalized ridge estimator.
Description
Function that evaluates the degrees of freedom of the generalized ridge estimator of the regression parameter of generalized linear models.
Usage
ridgeGLMdof(X, U=matrix(ncol=0, nrow=nrow(X)), lambda,
lambdaG, Dg=matrix(0, ncol=ncol(X), nrow=ncol(X)),
model="linear", linPred=rep(0,nrow(X)))
Arguments
X |
The design |
U |
The design |
lambda |
A positive |
lambdaG |
A positive |
Dg |
A non-negative definite |
model |
A |
linPred |
A |
Details
The degrees of freedom of the regular ridge regression estimator is usually defined the trace of the ridge hat matrix: \mbox{tr} [ \mathbf{X} (\mathbf{X}^{\top} \mathbf{X} + \lambda \mathbf{I}_{pp})^{-1} \mathbf{X}^{\top}]
. That of the regular ridge logistic regression estimator is defined analoguously by Park, Hastie (2008). Lettink et al. (2022) translates these definitions to the generalized ridge (logistic) regression case.
Value
A numeric
, the degrees of freedom consumed by the (generalized) ridge (logistic) regression estimator.
Author(s)
W.N. van Wieringen.
References
Park, M. Y., & Hastie, T. (2008). Penalized logistic regression for detecting gene interactions. Biostatistics, 9(1), 30-50.
Lettink, A., Chinapaw, M.J.M., van Wieringen, W.N. (2022), "Two-dimensional fused targeted ridge regression for health indicator prediction from accelerometer data", submitted.
Examples
# set the sample size
n <- 50
# set the true parameter
betas <- (c(0:100) - 50) / 20
# generate covariate data
X <- matrix(rnorm(length(betas)*n), nrow=n)
# set the penalty parameter
lambda <- 3
# estimate the logistic regression parameter
dofs <- ridgeGLMdof(X, lambda=lambda, lambdaG=0,
model="logistic",
linPred=tcrossprod(X, t(betas)))