predict.vagam {vagam}R Documentation

Predictions from a fitted generalized additive model (GAM).

Description

Takes a fitted vagam object produced by the main vagam function and produces predictions given a new set of values for the model covariates or the original values used for the model fit.

Usage

## S3 method for class 'vagam'
predict(object, new.smoothX, new.paraX = NULL, terms = NULL, 
alpha = 0.05, type = "link", ...)

Arguments

object

An object of class "vagam".

new.smoothX

A new matrix of covariates, each of which are were entered as additive smooth terms in the fitted GAM.

new.paraX

A new matrix of covariates, each of which were be entered as parametric terms in the fitted GAM. Note the predictions will account for the intercept ONLY if new.paraX is supplied.

terms

If terms = NULL, prediction is made across all smoothing covariates. Else, prediction is made to the specified smoothing covariate, with no intercept added.

alpha

Level of significance for the pointwise confidence bands for predictions.

type

When type = "link" (default) the linear predictor (with associated standard errors) is returned. When type = "response" predictions on the scale of the response are returned (with associated standard errors).

...

This is currently ignored.

Details

Current implemented a basic method of constructing predictions either for a single smoothing covariate, or across all the smoothing (and parametric if supplied) covariates, based on a GAM fitted using the main vagam function. By default, standard errors and this pointwise confidence bands are also produced based on fitted vagam object. Under the variational approximations framework, the smooths and confidence bands are constructed based on the variational approximation to the posterior distribution of the smoothing coefficients (which are treated as random effects with a normal prior under the mixed model framework). Please see Hui et al., (2018) for more information.

Value

A data frame containing information such as the predicted response, standard errors, and lower and upper bounds of the pointwise confidence bands.

Author(s)

NA

References

See Also

vagam for the main fitting function

Examples

## Please see examples in the help file for the vagam function.

[Package vagam version 1.1 Index]