dfa_fitted {bayesdfa}R Documentation

Get the fitted values from a DFA as a data frame

Description

Get the fitted values from a DFA as a data frame

Usage

dfa_fitted(modelfit, conf_level = 0.95, names = NULL)

Arguments

modelfit

Output from fit_dfa.

conf_level

Probability level for CI.

names

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

Value

A data frame with the following columns: ID is an identifier for each time series, time is the time step, y is the observed values standardized to mean 0 and unit variance, estimate is the mean fitted value, lower is the lower CI, and upper is the upper CI.

See Also

predicted plot_fitted fit_dfa

Examples


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)
fitted <- dfa_fitted(m)


[Package bayesdfa version 1.1.0 Index]