predict.MLGL {MLGL} | R Documentation |
Predict fitted values from a MLGL
object
Description
Predict fitted values from a MLGL
object
Usage
## S3 method for class 'MLGL'
predict(object, newx = NULL, s = NULL, type = c("fit", "coefficients"), ...)
Arguments
object |
|
newx |
matrix with new individuals for prediction. If type="coefficients", the parameter has to be NULL |
s |
values of lambda. If NULL, use values from object |
type |
if "fit", return the fitted values for each values of s, if "coefficients", return the estimated coefficients for each s |
... |
Not used. Other arguments to predict. |
Value
A matrix with fitted values or estimated coefficients for given values of s.
Author(s)
original code from gglasso package Author: Yi Yang <yiyang@umn.edu>, Hui Zou <hzou@stat.umn.edu>
function inspired from predict function from gglasso package by Yi Yang and Hui Zou.
See Also
Examples
X <- simuBlockGaussian(n = 50, nBlock = 12, sizeBlock = 5, rho = 0.7)
y <- drop(X[, c(2, 7, 12)] %*% c(2, 2, -1)) + rnorm(50, 0, 0.5)
m1 <- MLGL(X, y, loss = "ls")
predict(m1, newx = X)
predict(m1, s=3, newx = X)
predict(m1, s=1:3, newx = X)
[Package MLGL version 1.0.0 Index]