IWLSCoxridge {multiridge} | R Documentation |
Iterative weighted least squares algorithm for Cox ridge regression.
Description
Iterative weighted least squares algorithm for Cox ridge regression. Updates the weights and linear predictors until convergence.
Usage
IWLSCoxridge(XXT, Y, X1 = NULL, intercept = FALSE, eps = 1e-07, maxItr = 25,
trace = FALSE, E0 = NULL)
Arguments
XXT |
Matrix. Dimensions |
Y |
Response vector: class |
X1 |
Matrix. Dimension |
intercept |
Boolean. Should an intercept be included? |
eps |
Scalar. Numerical bound for IWLS convergence. |
maxItr |
Integer. Maximum number of iterations used in IWLS. |
trace |
Boolean. Should the output of the IWLS algorithm be traced? |
E0 |
Numerical vector or |
Details
Usually, Cox ridge regression does not use an intercept, as this is part of the baseline hazard. The latter is estimated using the Breslow estimator. To keep the function computationally efficient it returns the linear predictors (which suffice for predictions), instead of parameter estimates. These may be obtained by applying the betasout
function to the output of this function.
Value
List, containing:
etas |
Numerical vector: Final linear predictors |
Ypred |
Predicted survival |
convergence |
Boolean: has IWLS converged? |
nIt |
Number of iterations |
Hres |
Auxiliary list object. Passed on to other functions |
linearized |
Linearized predictions |
unpen |
Boolean: are there any unpenalized covariates involved? Passed on to other functions |
intercept |
Boolean: Is an intercept included? |
eta0 |
Numerical vector: Initial linear predictors |
X1 |
Matrix: design matrix unpenalized variables |
References
Mark A. van de Wiel, Mirrelijn van Nee, Armin Rauschenberger (2021). Fast cross-validation for high-dimensional ridge regression. J Comp Graph Stat
See Also
IWLSridge
for linear and logistic ridge. betasout
for obtaining parameter estimates.
predictIWLS
for predictions on new samples. A full demo and data are available from:
https://drive.google.com/open?id=1NUfeOtN8-KZ8A2HZzveG506nBwgW64e4
Examples
data(dataXXmirmeth)
resp <- dataXXmirmeth[[1]]
XXmirmeth <- dataXXmirmeth[[2]]
lambdas <- c(100,1000)
# Create fake survival data
respsurv <- Surv(rexp(length(resp)),resp)
# Prepare fitting for the specified penalties.
XXT <- SigmaFromBlocks(XXmirmeth,penalties=lambdas)
# Fit. fit$etas contains the n linear predictors
fit <- IWLSCoxridge(XXT,Y=respsurv)