Learn R Programming

BGGM (version 1.0.0)

posterior_predict: Posterior Predictive Distribution for estimate Objects

Description

Posterior Predictive Distribution for estimate Objects

Usage

posterior_predict(
  object,
  iter = 500,
  cred = 0.95,
  newdata = NULL,
  summary = TRUE,
  ...
)

Arguments

object

object of class estimate

iter

iters used to compute the residuals

cred

credible interval used for summarizing

newdata

an optional data frame for obtaining predictions (e.g., on test data)

summary

summarize the posterior samples (Default is TRUE). Setting it to FALSE can be used to then compute performance metrics.

...

currently ignored

Value

summary = TRUE: 3D array of dimensions n (observations), 4 (posterior summary), p (number of nodes). summary = FALSE: list containing predictions for each variable

Examples

Run this code
# NOT RUN {
# data
Y <- subset(tas, gender == "M")[,-ncol(tas)]

# fit model
fit <- estimate(Y)

# predict
posterior_predict(fit, iter = 25)
# }

Run the code above in your browser using DataLab