Description Usage Arguments Value Author(s) See Also Examples
Makes predictions from a cross-validated 'rbridge' model
1 2 |
object |
A 'rbridge' object. |
s |
Value(s) of the penalty parameter lambda at which predictions are required. |
... |
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 14 15 16 17 | set.seed(2019)
beta <- c(3, 1.5, 0, 0, 2, 0, 0, 0)
p <- length(beta)
beta <- matrix(beta, nrow = p, ncol = 1)
### Restricted Matrix and vector
c1 <- c(1,1,0,0,1,0,0,0)
R1.mat <- matrix(c1,nrow = 1, ncol = p)
r1.vec <- as.matrix(c(6.5),1,1)
n = 100
X = matrix(rnorm(n*p),n,p)
y = X%*%beta + rnorm(n)
######## Model 1 based on first restrictions
model1 <- rbridge(X, y, q = 1, R1.mat, r1.vec)
coef(model1,s='lambda.min')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.