ridgeGLM {porridge} | R Documentation |
Ridge estimation of generalized linear models.
Description
Function that evaluates the targeted ridge estimator of the regression parameter of generalized linear models.
Usage
ridgeGLM(Y, X, U=matrix(ncol=0, nrow=length(Y)), lambda,
lambdaG=0, Dg=matrix(0, ncol=ncol(X), nrow=ncol(X)),
target=rep(0, ncol(X)), model="linear",
minSuccDiff=10^(-10), maxIter=100)
Arguments
Y |
A |
X |
The design |
U |
The design |
lambda |
A positive |
lambdaG |
A positive |
Dg |
A non-negative definite |
target |
A |
model |
A |
minSuccDiff |
A |
maxIter |
A |
Details
This function finds the maximizer of the following penalized loglikelihood: , with loglikelihood
, response
, design matrices
and
, regression parameters
and
, penalty parameter
, shrinkage target
, and generalized ridge penalty matrix
. For more details, see van Wieringen, Binder (2020) and Lettink et al. (2022).
Value
A numeric
, the generalized ridge estimate of the regression parameter. If a nonempty is supplied, the first few elements are the unpenalized effect estimates of the covariates that comprise this design matrix.
Note
The penalized IRLS (Iterative Reweighted Least Squares) algorithm for the evaluation of the generalized ridge logistic regression estimator may fail to converge for small penalty parameter values in combination with a nonzero shrinkage target.
Author(s)
W.N. van Wieringen.
References
van Wieringen, W.N. Binder, H. (2022), "Sequential learning of regression models by penalized estimation", submitted.
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)
# sample the response
probs <- exp(tcrossprod(betas, X)[1,]) / (1 + exp(tcrossprod(betas, X)[1,]))
Y <- numeric()
for (i in 1:n){
Y <- c(Y, sample(c(0,1), 1, prob=c(1-probs[i], probs[i])))
}
# set the penalty parameter
lambda <- 3
# estimate the logistic regression parameter
bHat <- ridgeGLM(Y, X, lambda=lambda, target=betas/2, model="logistic")