predict.SIS | R Documentation |
Similar to the usual predict methods, this function returns predictions from
a fitted 'SIS'
object.
## S3 method for class 'SIS'
predict(
object,
newx,
lambda = object$lambda,
which = NULL,
type = c("response", "link", "class"),
...
)
object |
Fitted |
newx |
Matrix of new values for |
lambda |
Penalty parameter |
which |
Indices of the penalty parameter |
type |
Type of prediction required. Type |
... |
Not used. Other arguments to predict. |
The object returned depends on type.
Jianqing Fan, Yang Feng, Diego Franco Saldana, Richard Samworth, and Yichao Wu
Diego Franco Saldana and Yang Feng (2018) SIS: An R package for Sure Independence Screening in Ultrahigh Dimensional Statistical Models, Journal of Statistical Software, 83, 2, 1-25.
Jianqing Fan and Jinchi Lv (2008) Sure Independence Screening for Ultrahigh Dimensional Feature Space (with discussion). Journal of Royal Statistical Society B, 70, 849-911.
Jianqing Fan and Rui Song (2010) Sure Independence Screening in Generalized Linear Models with NP-Dimensionality. The Annals of Statistics, 38, 3567-3604.
Jianqing Fan, Richard Samworth, and Yichao Wu (2009) Ultrahigh Dimensional Feature Selection: Beyond the Linear Model. Journal of Machine Learning Research, 10, 2013-2038.
Jianqing Fan, Yang Feng, and Yichao Wu (2010) High-dimensional Variable Selection for Cox Proportional Hazards Model. IMS Collections, 6, 70-86.
Jianqing Fan, Yang Feng, and Rui Song (2011) Nonparametric Independence Screening in Sparse Ultrahigh Dimensional Additive Models. Journal of the American Statistical Association, 106, 544-557.
Diego Franco Saldana and Yang Feng (2014) SIS: An R package for Sure Independence Screening in Ultrahigh Dimensional Statistical Models, Journal of Statistical Software.
SIS
set.seed(0)
n <- 400
p <- 50
rho <- 0.5
corrmat <- diag(rep(1 - rho, p)) + matrix(rho, p, p)
corrmat[, 4] <- sqrt(rho)
corrmat[4, ] <- sqrt(rho)
corrmat[4, 4] <- 1
corrmat[, 5] <- 0
corrmat[5, ] <- 0
corrmat[5, 5] <- 1
cholmat <- chol(corrmat)
x <- matrix(rnorm(n * p, mean = 0, sd = 1), n, p)
x <- x %*% cholmat
colnames(x) <- unlist(lapply(seq(1:dim(x)[2]), function(y) paste0('V',y)))
testX <- matrix(rnorm(10 * p, mean = 0, sd = 1), nrow = 10, ncol = p)
# gaussian response
set.seed(1)
b <- c(4, 4, 4, -6 * sqrt(2), 4 / 3)
y <- x[, 1:5] %*% b + rnorm(n)
model1 <- SIS(x, y, family = "gaussian", tune = "bic", varISIS = "aggr", seed = 11)
predict(model1, testX, type = "response")
predict(model1, testX, which = 1:10, type = "response")
## Not run:
# binary response
set.seed(2)
feta <- x[, 1:5] %*% b
fprob <- exp(feta) / (1 + exp(feta))
y <- rbinom(n, 1, fprob)
model2 <- SIS(x, y, family = "binomial", tune = "bic", varISIS = "aggr", seed = 21)
predict(model2, testX, type = "response")
predict(model2, testX, type = "link")
predict(model2, testX, type = "class")
predict(model2, testX, which = 1:10, type = "response")
predict(model2, testX, which = 1:10, type = "link")
predict(model2, testX, which = 1:10, type = "class")
# poisson response
set.seed(3)
b <- c(0.6, 0.6, 0.6, -0.9 * sqrt(2))
myrates <- exp(x[, 1:4] %*% b)
y <- rpois(n, myrates)
model3 <- SIS(x, y,
family = "poisson", penalty = "lasso", tune = "bic",
varISIS = "aggr", seed = 31)
predict(model3, testX, type = "response")
predict(model3, testX, type = "link")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.