View source: R/MultiLambdaCVfun.R
predictIWLS | R Documentation |
Produces predictions from ridge fits for new data.
predictIWLS(IWLSfit, X1new = NULL, Sigmanew)
IWLSfit |
List, containing fits from either |
X1new |
Matrix. Dimension |
Sigmanew |
Matrix. Dimensions |
Predictions rely purely on the linear predictors, and do not require producing the parameter vector.
Numerical vector of linear predictor for the test samples.
IWLSridge
(IWLSCoxridge
) for fitting linear and
logistic ridge (Cox ridge). betasout
for obtaining parameter
estimates.
Scoring
to evaluate the predictions. A full demo and data are available from:
https://drive.google.com/open?id=1NUfeOtN8-KZ8A2HZzveG506nBwgW64e4
#Example below shows how to create the input argument Sigmanew (for simulated data) #Simulate Xbl1 <- matrix(rnorm(1000),nrow=10) Xbl2 <- matrix(rnorm(2000),nrow=10) Xbl1new <- matrix(rnorm(200),nrow=2) Xbl2new <- matrix(rnorm(400),nrow=2) #check whether dimensions are correct nrow(Xbl1)==nrow(Xbl1new) nrow(Xbl2)==nrow(Xbl2new) ncol(Xbl1)==nrow(Xbl2) ncol(Xbl1new)==ncol(Xbl2new) #create cross-product XXbl <- createXXblocks(list(Xbl1,Xbl2),list(Xbl1new,Xbl2new)) #suppose penalties for two data types equal 5,10, respectively Sigmanew <- SigmaFromBlocks(XXbl,c(5,10)) #check dimensions (should be nnew x n) dim(Sigmanew)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.