Using the bayesdfa package

Functions for fitting Bayesian dynamic factor analyses

fit_dfa()

Fit a Bayesian DFA

sim_dfa()

Simulate from a DFA

find_dfa_trends()

Find the best number of trends according to LOOIC

dfa_cv()

Apply cross validation to DFA model

Diagnostics for fitted models

Functions for evaluating convergence of DFA moddels

find_swans()

Find outlying "black swan" jumps in trends

is_converged()

Summarize Rhat convergence statistics across parameters

loo(<bayesdfa>)

LOO information criteria

predicted()

Calculate predicted value from DFA object

rotate_trends()

Rotate the trends from a DFA

trend_cor()

Estimate the correlation between a DFA trend and some other timeseries

Extracting DFA output

Functions for extracting common outputs

dfa_fitted()

Get the fitted values from a DFA as a data frame

dfa_loadings()

Get the loadings from a DFA as a data frame

dfa_trends()

Get the trends from a DFA as a data frame

Univariate Hidden Markov Models

Functions for evaluating regimes with univariate HMMs

hmm_init()

Create initial values for the HMM model.

find_regimes()

Fit multiple models with differing numbers of regimes to trend data

fit_regimes()

Fit models with differing numbers of regimes to trend data

Plotting

Functions for plotting DFA and HMM models

plot_fitted()

Plot the fitted values from a DFA

plot_loadings()

Plot the loadings from a DFA

plot_regime_model()

Plot the state probabilities from find_regimes()

plot_trends()

Plot the trends from a DFA