Similar to other predict methods, this functions predicts fitted values,
coefficients and more from a fitted "classo" object.
# S3 method for classo
coef(object, s = NULL, exact = FALSE, ...)# S3 method for classo
predict(
object,
newx,
s = NULL,
type = c("response", "coefficients", "nonzero"),
exact = FALSE,
...
)
The object returned depends on type.
Fitted "classo" model object.
Value(s) of the penalty parameter lambda at which
predictions are required. Default is the entire sequence used to create the
model.
This argument is relevant only when predictions are made at
values of s (lambda) different from those used in the fitting
of the original model. If exact=FALSE (default), then the predict function
uses linear interpolation to make predictions for values of s (lambda) that do
not coincide with those used in the fitting algorithm. While this is often a
good approximation, it can sometimes be a bit coarse. With
exact=TRUE, these different values of s are merged (and
sorted) with object$lambda, and the model is refit before predictions
are made. In this case, it is required to supply the original data x=
and y= as additional named arguments to predict() or
coef(). The workhorse predict.classo() needs to update
the model, and so needs the data used to create it. The same is true of
weights if these were used in the original call. Failure to do
so will result in an error.
type="nonzero")
This is the mechanism for passing arguments like x= when
exact=TRUE; seeexact argument.
Matrix of new values for x at which predictions are to be
made. Must be a matrix. This #' argument is not used for type=c("coefficients","nonzero")
Type of prediction required. Type "link" givee the fitted
values for "gaussian". Type "response" is equivalent to type
"link". Type "coefficients" computes the coefficients at the
requested values for s. Type "nonzero" returns a list of the indices
of the nonzero coefficients for each value of s.
Younghoon Kim, Navonil Deb, and Sumanta Basu
Maintainer:
Younghoon Kim yk748@cornell.edu
This function actually calls NextMethod().
coef(...) is equivalent to predict(type="coefficients",...)
Deb, N., Kuceyeski, A. and Basu, S. (2024) Regularized estimation of sparse spectral precision matrices (2024), Preprint, https://arxiv.org/abs/2401.11128.
classo, and print, and coef methods, and
cv.classo.