- fit
A fitted model object of class mlts.fit. Only used if fit_list is NULL.
- fit_list
An optional list of fitted mlts.fit objects for model comparison. If provided, fit is ignored.
- ts
Optional vector of variable names to include in the plot.
- y_reps
Optional. A list of posterior predictive samples (as returned by mlts_posterior_sample) for a single model.
If NULL, samples are generated within the function.
- by_cluster
Logical. If TRUE, density plots are faceted by individual and time-series variable.
If FALSE, only time-series variables are used for faceting. Default is FALSE.
- by_group
Logical. If TRUE, density plots are faceted by grouping and time-series variable.
If FALSE, only time-series variables are used for faceting. Default is FALSE.
- cluster_ids
Optional vector of cluster IDs to include in the plot. If NULL, all IDs are shown.
- draw_person_pars
Logical. If TRUE, samples are generated using person-specific parameters (random effects).
If FALSE, only population-level parameters are used. Defaults to FALSE.
- n_draws
Integer. Number of posterior draws to use for generating replicated datasets. Defaults to 20.
Ignored if draws is specified.
- draws
Optional vector of indices specifying which posterior draws to use. If NULL, n_draws samples are drawn randomly.
- add_y_obs
Logical. Whether to include the observed data distribution in the plot. Defaults to TRUE.
- model_lab
Optional character vector with labels for each model in fit_list. If NULL, defaults to "Model 1", "Model 2", etc.
- y_rep_col
Optional vector of colors for the posterior predictive densities of each model. If NULL, a default color palette is used.
- y_obs_col
Color for the observed data distribution. Default is "#009E73".
- y_obs_lw
Line width of the observed data density curve. Default is 1.1.
- y_rep_lw
Line width of the observed data density curve. Default is 0.5.
- y_rep_alpha
Alpha transparency for the predictive density curves. Default is 0.5.