Learn R Programming

BGGM (version 2.1.5)

predict.explore: Model Predictions for explore Objects

Description

Model Predictions for explore Objects

Usage

# S3 method for explore
predict(
  object,
  newdata = NULL,
  summary = TRUE,
  cred = 0.95,
  iter = NULL,
  progress = TRUE,
  ...
)

Value

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

Arguments

object

object of class explore

newdata

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

summary

summarize the posterior samples (defaults to TRUE).

cred

credible interval used for summarizing

iter

number of posterior samples (defaults to all in the object).

progress

Logical. Should a progress bar be included (defaults to TRUE) ?

...

currently ignored

Examples

Run this code
# \donttest{
# data
Y <- ptsd

# fit model
fit <- explore(Y, iter = 250,
               progress = FALSE)

# predict
pred <- predict(fit,
                progress = FALSE)

# }

Run the code above in your browser using DataLab