coevfit
objectR/coev_plot_pred_series.R
coev_plot_pred_series.Rd
This function plots a predicted coevolutionary time series using the
estimated parameters from a fitted coevfit
model. By default, the
plot uses the posterior ancestral states estimated by the model as the
starting values, but users can also set their own starting values for
traits. Plots can be generated with or without stochastic drift. For more
details on the underlying predictive function, see
help(coev_pred_series)
.
coev_plot_pred_series(object, prob = 0.95, ...)
An object of class coevfit
A value between 0 and 1 indicating the desired probability to be covered by the uncertainty intervals. The default is 0.95.
Additional arguments passed to coev_pred_series
A ggplot object
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
)
# simulated trait co-evolution
coev_plot_pred_series(
object = fit,
stochastic = TRUE
)
# expected trait co-evolution, no drift
coev_plot_pred_series(
object = fit,
stochastic = FALSE,
eta_anc = list(political_authority = -2, religious_authority = 1.5)
)
} # }