find_inverted_chains {bayesdfa} | R Documentation |
Find which chains to invert by checking the sum of the squared deviations between the first chain and each other chain.
find_inverted_chains(model, trend = 1, plot = FALSE)
model |
A Stan model, |
trend |
Which trend to check |
plot |
Logical: should a plot of the trend for each chain be made?
Defaults to |
invert_chains
set.seed(2) s <- sim_dfa(num_trends = 2) set.seed(1) m <- fit_dfa(y = s$y_sim, num_trends = 1, iter = 30, chains = 2) # chains were already inverted, but we can redo that, as an example, with: find_inverted_chains(m$model, plot = TRUE)