predicted: Calculate predicted value from DFA object

Description Usage Arguments Examples

View source: R/predicted.R

Description

Pass in rstanfit model object. Returns array of predictions, dimensioned number of MCMC draws x number of MCMC chains x time series length x number of time series

Usage

1
predicted(fitted_model)

Arguments

fitted_model

Samples extracted (with permuted = FALSE) from a Stan model. E.g. output from invert_chains().

Examples

1
2
3
4
5
6
7
8
## Not run: 
set.seed(42)
s <- sim_dfa(num_trends = 1, num_years = 20, num_ts = 3)
# only 1 chain and 1000 iterations used so example runs quickly:
m <- fit_dfa(y = s$y_sim, iter = 2000, chains = 3, num_trends = 1)
pred <- predicted(m)

## End(Not run)

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