Extract latent factor posteriors from fit
Usage
latent_factors(fit, summary = TRUE, probs = c(0.025, 0.5, 0.975))Value
If summary = TRUE, a data frame with columns for observation,
factor, and summary statistics. If summary = FALSE, a matrix of
posterior draws.
Examples
if (FALSE) { # \dontrun{
# After fitting with latent factors
fit <- tratio(
count | total ~ x,
data = df,
family = ratiod_negbin_negbin(),
latent = latent_factor(n_factors = 2)
)
# Get summary
factors <- latent_factors(fit)
head(factors)
# Get full posterior draws
factor_draws <- latent_factors(fit, summary = FALSE)
} # }