R: Make predictions or extract coefficients from a cosso model
predict.cosso
R Documentation
Make predictions or extract coefficients from a cosso model
Description
Make prediction for future observations or extract the model parameters at a particular smoothing parameter.
Usage
## S3 method for class 'cosso'
predict(object,xnew,M,type=c("fit","coefficients","nonzero"),eps=1e-7,...)
Arguments
object
a cosso object.
xnew
matrix of new values for x at which predictions are to be made. Object must be a matrix and have the same dimension as the training design points. Continuous variable will also have to be scaled to [0,1] interval.
M
a smoothing parameter value. M should be taken between 0 and p. If not provided, a cross-validation procedure will be carried out to select an appropriate value.
type
if type="fit" (default), fitted values will be returned. If type="coefficients", model coefficients will be returned. Abbreviations are allowed.
eps
an effective zero, default is 1e-7
...
additional arguments for predict function.
Value
The object returned depends on type.
When type="fit", predicted
eta
function value will be given at the new design points xnew.
When type="coefficients", three sets of coefficients will be returned.
Intercept
the estimated intercept. If family="Cox", the intercept is zero.
coefs
the estimated coefficients for kernel representers.
theta
the estimated scale parameters for each functional component.
When type="nonzero", a list of the indices of the nonconstant functional components will be returned.