find_inverted_chains: Find which chains to invert

Description Usage Arguments See Also Examples

View source: R/invert_chains.R

Description

Find which chains to invert by checking the sum of the squared deviations between the first chain and each other chain.

Usage

1
find_inverted_chains(model, trend = 1, plot = FALSE)

Arguments

model

A Stan model, rstanfit object

trend

Which trend to check

plot

Logical: should a plot of the trend for each chain be made? Defaults to FALSE

See Also

invert_chains

Examples

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

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