Learn R Programming

glm.ddR (version 0.1.0)

predict.dglm: Predict Method for dglm fits

Description

It produces predicted values, obtained by evaluating the regression function on provided new data.

Usage

"predict"(object, newdata, type = c("link", "response"), na.action = na.pass, mask = NULL, trace = FALSE, ...)

Arguments

object
a built model of type dglm.
newdata
a matrix or a darray containing predictors of new samples.
type
the type of prediction required which can be "link" or "response".
na.action
a function to determine what should be done with missing values. At this version it is always na.pass (reserved for future improvement).
mask
a darray with a single column, and 0 or 1 as the value of its elements. It indicates which samples (rows) should be considered in the calculation.
trace
when this argument is true, intermediate steps of the progress are displayed.
...
further arguments passed to or from other methods.

Value

The output is a matrix or a darray, depending to the type of newdata, which contains predicted values for response.

Details

This function produces predicted values, obtained by evaluating the regression function on provided new data. New data can be either a darray or a normal matrix.

Examples

Run this code
 ## Not run: 
#     library(glm.ddR)
# 
#     Y <- as.darray(data.matrix(faithful["eruptions"]))
#     X <- as.darray(data.matrix(faithful["waiting"]))
# 
#     myModel <- dglm(Y, X)
#     newSamples <- matrix(c(1:3),,1)
#     predict(myModel, newSamples, "link")
#  ## End(Not run)

Run the code above in your browser using DataLab