Description Usage Arguments Value Examples
View source: R/predict_bayescopulaglm.R
Sample from the predictive posterior density of a copula generalized linear model regression
1 2 |
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 |
array
of dimension c(n, J, nsims)
of predicted values, where J
is the number of endpoints
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.