predict.BGR: Predict Method for Bivariate Gamma Regressions

Description Usage Arguments Value Examples

View source: R/predict.BGR.R

Description

Obtains predictions from the fitted bivariate gamma regression models.

Usage

1
2
3
4
5
6
7
8
## S3 method for class 'BGR'
predict(object, newdata, ...)

predict_BGR_EE(object, newdata, ...)

predict_BGR_EI(object, newdata, ...)

predict_BGR_IE(object, newdata, ...)

Arguments

object

a fitted model object of class "BGR" or "MBGR"

newdata

a data frame that prediction is based upon

...

further arguments passed to or from other methods.

Value

a list with components (depends on model class):

fit

predictions.

alpha1.fit

predicted alpha1 values.

alpha2.fit

predicted alpha2 values.

alpha3.fit

predicted alpha3 values.

beta.fit

predicted beta values.

tau.fit

predicted mixing proportion values, if covariates enter the gating network.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
mod1 <- BGR(modelName = "EE",
            y = c("y1","y2"), data = fullsim,
            f1 = ~ w1 + w2,
            f2 = ~ w2 + w3,
            f3 = ~ w1 + w2 + w3,
            f4 = ~ w1 + w2 + w3,
            verbose= FALSE)
fitted1 <- predict(mod1, newdata=fullsim)
plot(fitted1$fit)

mod2 <- BGR(modelName = "EI",
            y = c("y1","y2"), data = fullsim,
            f1     = ~ w1 + w2,
            f2     = ~ w2 + w3,
            f3     = ~ w1 + w2 + w3,
            verbose= FALSE)
fitted2 <- predict(mod2, newdata=fullsim)
mod3 <- BGR(modelName = "IE",
            y = c("y1","y2"), data = fullsim,
            f4     = ~ w1 + w2 + w3,
            verbose= FALSE)
fitted3 <- predict(mod3, newdata=fullsim)
plot(fitted2$fit)
plot(fitted3$fit)

senhu/mvClaim documentation built on Jan. 29, 2022, 3:18 p.m.