find_inverted_chains {bayesdfa}R Documentation

Find which chains to invert

Description

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

Usage

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

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)

[Package bayesdfa version 1.1.0 Index]