predict.bayescopulaglm {bayescopulareg} | R Documentation |
Predictive posterior sample from copula GLM
Description
Sample from the predictive posterior density of a copula generalized linear model regression
Usage
## S3 method for class 'bayescopulaglm'
predict(object, newdata, nsims = 1, ...)
Arguments
object |
Result from calling |
newdata |
|
nsims |
number of posterior draws to take. The default and minimum is 1. The maximum is the number of simulations in |
... |
further arguments passed to or from other methods |
Value
array
of dimension c(n, J, nsims)
of predicted values, where J
is the number of endpoints
Examples
set.seed(1234)
n <- 100
M <- 1000
x <- runif(n, 1, 2)
y1 <- 0.25 * x + rnorm(100)
y2 <- rpois(n, exp(0.25 * x))
formula.list <- list(y1 ~ 0 + x, y2 ~ 0 + x)
family.list <- list(gaussian(), poisson())
data = data.frame(y1, y2, x)
## Perform copula regression sampling with default
## (noninformative) priors
sample <- bayescopulaglm(
formula.list, family.list, data, M = M
)
predict(sample, newdata = data)
[Package bayescopulareg version 0.1.3 Index]