coevfit objectR/coev_plot_predictive_check.R
coev_plot_predictive_check.RdPlot posterior (or prior) predictive checks for variables from a fitted
coevfit object, with help from the bayesplot package.
coev_plot_predictive_check(
object,
variables = NULL,
ndraws = NULL,
tree_id = NULL
)An object of class coevfit
If NULL (default), the function returns a list of plots for all coevolving variables from the model. Otherwise, a character vector declaring the variables to be included in the list of plots.
An integer indicating the number of draws to return. The default and maximum number of draws is the size of the posterior sample.
An integer indicating the tree ID to use when making
posterior predictions. Set to NULL by default, which will use draws
from every tree, integrating phylogenetic uncertainty.
A list of ggplot objects
if (FALSE) { # \dontrun{
# fit dynamic coevolutionary model
fit <- coev_fit(
data = authority$data,
variables = list(
political_authority = "ordered_logistic",
religious_authority = "ordered_logistic"
),
id = "language",
tree = authority$phylogeny,
# additional arguments for cmdstanr::sample()
chains = 4,
parallel_chains = 4,
seed = 1
)
# plot predictive checks for all variables
coev_plot_predictive_check(fit)
} # }