ggmix_gic
objectThis function makes predictions from a ggmix_gic
object,
using the stored "ggmix_fit" object, and the optimal value chosen for
lambda using the gic.
# S3 method for ggmix_gic
predict(object, newx, s = c("lambda.min"), ...)# S3 method for ggmix_gic
coef(object, s = c("lambda.min"), type, ...)
fitted ggmix_gic
object
matrix of values for x
at which predictions are to be
made. Do not include the intercept. Must be a matrix. This argument is not
used for type = c("coefficients","nonzero","all")
. This matrix must
have the same number of columns originally supplied to the
ggmix
fitting function.
Value(s) of the penalty parameter lambda
at which predictions
are required. Default is the value s="lambda.min"
can be used. If
s
is numeric, it is taken as the value(s) of lambda
to be
used.
other arguments passed to predict.ggmix_fit
Type of prediction required. Type "link"
gives the fitted
values \(X \beta\). Type "response"
is equivalent to type
"link"
. Type "coefficients"
computes the coefficients at the
requested values for s
and returns the regression coefficients only,
including the intercept. Type "all"
returns both the regression
coefficients and variance components at the requested value of s
.
Type "nonzero"
returns a 1 column matrix of the the nonzero fixed
effects, as well as variance components for each value of s
. If more
than one s
is provided, then "nonzero"
will return a list of
1 column matrices. Default: "link"
The object returned depends the ... argument which is passed on to
the predict method for ggmix_fit
objects.
This function makes it easier to use the results of gic chosen model to make a prediction.