predict.dglm: Predict Method for dglm fits

Description Usage Arguments Details Value Author(s) Examples

View source: R/dglm.R

Description

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

Usage

1
2
3
## S3 method for class 'dglm'
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.

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.

Value

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

Author(s)

Vishrut Gupta, Arash Fard

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
 ## 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)

glm.ddR documentation built on May 29, 2017, 6:49 p.m.