plot_fitted: Plot the fitted values from a DFA

Description Usage Arguments See Also Examples

View source: R/plot_fitted.R

Description

Plot the fitted values from a DFA

Usage

1
plot_fitted(modelfit, conf_level = 0.95, names = NULL, spaghetti = FALSE)

Arguments

modelfit

Output from fit_dfa, a rstanfit object

conf_level

Probability level for CI.

names

Optional vector of names for plotting labels TODO. Should be same length as the number of time series

spaghetti

Defaults to FALSE, but if TRUE puts all raw time series (grey) and fitted values on a single plot

See Also

plot_loadings fit_dfa rotate_trends dfa_fitted

Examples

1
2
3
4
5
6
7
y <- sim_dfa(num_trends = 2, num_years = 20, num_ts = 4)
m <- fit_dfa(y = y$y_sim, num_trends = 2, iter = 50, chains = 1)
p <- plot_fitted(m)
print(p)

p <- plot_fitted(m, spaghetti = TRUE)
print(p)

bayesdfa documentation built on May 29, 2021, 1:06 a.m.