Learn R Programming

cosso (version 2.0-2)

predict.cosso: 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"),...)

Arguments

object
a cosso object.
xnew
future input values for response prediction
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.
...
additional arguments for predict function.

Value

  • Either a vector of fitted values, or a list containing estimated model coefficients. When type="coefficients", three sets of coefficients will be returned.
  • Interceptthe estimated intercept
  • coefsthe estimated coefficients for kernel representers
  • thetathe estimated scale parameters for each functional component

References

Lin, Y and Zhang, H. H. (2006). "Component Selection and Smoothing in Smoothing Spline Analysis of Variance Models", Annals of Statistics, 34, 2272--2297. Storlie, C. B., Bondell, H. D., Reich, B. J. and Zhang, H. H. (2011). "Surface estimation, variable selection, and the nonparametric oracle property", Statistica Sinica, 21, 679--705.

See Also

plot.cosso

Examples

Run this code
data(ozone)
ozone_cosso <- cosso(x=ozone[,-1],y=ozone[,1],nbasis=100)
predict.cosso(ozone_cosso,ozone[,-1],M=2,type="fit")
predict.cosso(ozone_cosso,M=2,type="c")

Run the code above in your browser using DataLab