predict.spar.cv {spareg}R Documentation

predict.spar.cv

Description

Predict responses for new predictors from 'spar.cv' object

Usage

## S3 method for class 'spar.cv'
predict(
  object,
  xnew,
  type = c("response", "link"),
  avg_type = c("link", "response"),
  opt_par = c("best", "1se"),
  nummod = NULL,
  nu = NULL,
  coef = NULL,
  ...
)

Arguments

object

result of spar function of class 'spar.cv'.

xnew

matrix of new predictor variables; must have same number of columns as x.

type

the type of required predictions; either on response level (default) or on link level

avg_type

type of averaging the marginal models; either on link (default) or on response level

opt_par

one of c("best","1se"), chooses whether to select the best pair of nus and nummods according to CV-Meas, or the sparsest solution within one sd of that optimal CV-Meas; ignored when nummod and nu, or coef are given

nummod

number of models used to form coefficients; value with minimal validation Meas is used if not provided.

nu

threshold level used to form coefficients; value with minimal validation Meas is used if not provided.

coef

optional; result of coef.spar.cv can be used.

...

further arguments passed to or from other methods

Value

Vector of predictions


[Package spareg version 1.0.0 Index]