Description Usage Arguments Value Author(s) See Also Examples
Makes predictions from a cross-validated 'cv.bridge' model
1 2 3 |
object |
A 'cv.bridge' object. |
newx |
Matrix of new values for x at which predictions are to be made. |
s |
Value(s) of the penalty parameter lambda at which predictions are required. |
type |
It should one of "response", "nonzero" or "coefficients". The "response" is for predicted values, the "nonzero" is for exacting non-zero coefficients and the "coefficients" is for the estimated coefficients. |
... |
Additional arguments for compatibility. |
Among a matrix with predictions, a vector non-zero indexing or a vector of coefficients
Bahadir Yuzbasi, Mohammad Arashi and Fikri Akdeniz
Maintainer: Bahadir Yuzbasi b.yzb@hotmail.com
1 2 3 4 5 6 7 8 9 10 11 12 13 | set.seed(2019)
beta <- c(3, 1.5, 0, 0, 2, 0, 0, 0)
p <- length(beta)
beta <- matrix(beta, nrow = p, ncol = 1)
n = 100
X = matrix(rnorm(n*p),n,p)
y = X%*%beta + rnorm(n)
model1 <- cv.bridge(X, y, q = 1)
coef(model1,s='lambda.min')
predict(model1,newx=X[1:5,], s="lambda.min", type="response")
predict(model1, s="lambda.min",type="coefficient")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.