Learn R Programming

mvgam (version 1.1.51)

lv_correlations: Calculate trend correlations based on latent factor loadings for mvgam models

Description

This function uses samples of latent trends for each series from a fitted mvgam model to calculates correlations among series' trends

Usage

lv_correlations(object)

Value

A list object containing the mean posterior correlations and the full array of posterior correlations

Arguments

object

list object of class mvgam

Examples

Run this code
# \donttest{
simdat <- sim_mvgam()
mod <- mvgam(y ~ s(season, bs = 'cc',
                  k = 6),
            trend_model = AR(),
            use_lv = TRUE,
            n_lv = 2,
            data = simdat$data_train,
            burnin = 300,
            samples = 300,
            chains = 2,
            silent = 2)
lvcors <- lv_correlations(mod)
names(lvcors)
lapply(lvcors, class)
# }

Run the code above in your browser using DataLab