predict.hglm {holiglm}R Documentation

Predict Method for HGLM Fits

Description

Obtains predictions from a fitted holistic generalized linear model object.

Usage

## S3 method for class 'hglm'
predict(object, newdata = NULL, type = c("link", "response"), ...)

Arguments

object

a fitted object of class inheriting from "hglm".

newdata

an optional data frame containing new observations for which predictions are to be made. If ommitted, the fitted linear predictors are used.

type

the type of predictions to be made. Possible values are "link" (default) or "response". If "link", the predictions are in the link scale; if "response", the predictions are transformed to the response scale.

...

optional arguments currently ignored.

Value

A vector of predicted values. If type = "link", the predicted values are in the link scale; if type = "response", the predicted values are in the response scale.

Examples

dat <- rhglm(100, c(1, 2, -3, 4, 5, -6))
fit <- hglm(y ~ ., constraints = k_max(3), data = dat)
pred <- predict(fit)
pred2 <- predict(fit, newdata=dat)

[Package holiglm version 1.0.0 Index]