
Standard deviations and correlations of group-level effects
Source:R/ranef.mvgam.R
VarCorr.mvgam.RdPosterior draws of the standard deviation of each group-level term of the observation formula, with the correlations and covariances of terms that share a grouping factor.
Arguments
- x
A fitted
mvgamobject.- sigma
A single non-negative number. It has no effect.
summary.mvgam()reports the observation family's scale.- summary
Logical.
TRUE(the default) summarises the draws.FALSEreturns them.- robust
Logical.
TRUEsummarises with the median and MAD. Defaults toFALSE.- probs
Numeric vector of the two quantiles to report.
- ...
Unused. Anything passed here is refused.
Value
A named list with one entry per grouping factor. Each entry is a list of these components:
sd: the standard deviation of each coefficient, a matrix of coefficients by statistics, or of draws by coefficients undersummary = FALSE.cor: correlation matrices, present when the factor carries two or more correlated coefficients. The array runs over coefficients, statistics and coefficients, or over draws and two coefficient axes undersummary = FALSE.cov: covariance matrices, shaped ascor.
Details
A trend-side component is named with the _trend suffix, as
sd_g__Intercept_trend. as_draws.mvgam() returns its draws.
See also
ranef.mvgam() gives each level's deviation.
fixef.mvgam() summarises the population-level effects.
Other posterior summaries:
bibtex(),
how_to_cite.mvgam(),
hypothesis.mvgam(),
index-mvgam,
mcmc_plot.mvgam(),
methods_md(),
mvgam_draws,
pairs.mvgam(),
posterior_interval.mvgam(),
ranef.mvgam(),
smooths.mvgam(),
summary.mvgam()
Examples
# \dontrun{
set.seed(14)
simdat <- sim_mvgam(family = poisson(), n_series = 4L,
n_timepoints = 120L, trend_model = AR())
mod <- mvgam(y ~ s(x, k = 5) + (1 | series),
trend_formula = ~ AR(p = 1),
data = simdat$data_train, family = poisson(),
chains = 2, silent = 2)
#> Warning: 24 of 2000 (1.0%) transitions ended with a divergence.
#> See https://mc-stan.org/misc/warnings for details.
# The standard deviation of the series intercepts
VarCorr(mod)$series$sd
#> Estimate Est.Error Q2.5 Q97.5
#> Intercept 0.2026411 0.2054635 0.00800586 0.7920425
# Next: ranef() gives each series' own deviation
# }