dfa_fitted: Get the fitted values from a DFA as a data frame

Description Usage Arguments Value See Also Examples

View source: R/dfa_fitted.R

Description

Get the fitted values from a DFA as a data frame

Usage

1
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

1
2
3
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)

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