Learn R Programming

picasso (version 2.0.1)

predict.gaussian: Prediction Method for an Object with S3 Class "gaussian"

Description

Predict responses for new data using fitted models.

Usage

# S3 method for gaussian
predict(object, newdata, lambda.idx = NULL, Y.pred.idx = NULL,
  type = "response", s = NULL, ...)

Value

Return type depends on type:

  • "response" or "link" (default): numeric matrix of predicted values \(\hat{\beta}_0 + X \hat{\beta}\).

  • "nonzero": list of integer vectors of nonzero coefficient indices, one element per selected lambda.

Rows correspond to observations; columns correspond to lambda.idx (or s values when s is specified).

Arguments

object

An object with S3 class "gaussian".

newdata

Nonempty finite numeric matrix of new observations for prediction (\(n_{new} \times d\)) with the same number of columns as the fitted design.

lambda.idx

Positive integer indices of regularization parameters along the solution path used for prediction. By default, at most the first three fitted path points are used.

Y.pred.idx

Optional row indices to subset returned predictions. NULL returns every prediction row.

type

Type of prediction. "response" (default) returns predicted values; "link" returns the linear predictor; "nonzero" returns a list of nonzero variable indices per selected lambda.

s

Optional nonempty vector of finite non-negative lambda values (not indices). When supplied, lambda.idx is ignored. If a requested value falls between two path lambdas the coefficients are linearly interpolated and a message is issued. Values outside the path range are clamped to the nearest endpoint. For type = "nonzero", the nearest fitted lambda is used instead because support sets cannot be interpolated.

...

Arguments to be passed to methods.

Author

Jason Ge, Xingguo Li, Haoming Jiang, Mengdi Wang, Tong Zhang, Han Liu and Tuo Zhao
Maintainer: Tuo Zhao <tourzhao@gatech.edu>

Details

predict.gaussian returns predicted responses for newdata using fitted coefficients from object: $$ \hat{Y} = \hat{\beta}_0 + X_{new} \hat{\beta}. $$

See Also

picasso and picasso-package.