Running examples in ‘bayesdfa-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: find_regimes
> ### Title: Fit multiple models with differing numbers of regimes to trend
> ###   data
> ### Aliases: find_regimes
> 
> ### ** Examples
> 
> data(Nile)
> find_regimes(log(Nile), iter = 50, chains = 1, max_regimes = 2)

SAMPLING FOR MODEL 'regime_1' NOW (CHAIN 1).
Chain 1: 
Chain 1: Gradient evaluation took 2.1e-05 seconds
Chain 1: 1000 transitions using 10 leapfrog steps per transition would take 0.21 seconds.
Chain 1: Adjust your expectations accordingly!
Chain 1: 
Chain 1: 
Chain 1: WARNING: There aren't enough warmup iterations to fit the
Chain 1:          three stages of adaptation as currently configured.
Chain 1:          Reducing each adaptation stage to 15%/75%/10% of
Chain 1:          the given number of warmup iterations:
Chain 1:            init_buffer = 3
Chain 1:            adapt_window = 20
Chain 1:            term_buffer = 2
Chain 1: 
Chain 1: Iteration:  1 / 50 [  2%]  (Warmup)
Chain 1: Iteration:  5 / 50 [ 10%]  (Warmup)
Chain 1: Iteration: 10 / 50 [ 20%]  (Warmup)
Chain 1: Iteration: 15 / 50 [ 30%]  (Warmup)
Chain 1: Iteration: 20 / 50 [ 40%]  (Warmup)
Chain 1: Iteration: 25 / 50 [ 50%]  (Warmup)
Chain 1: Iteration: 26 / 50 [ 52%]  (Sampling)
Chain 1: Iteration: 30 / 50 [ 60%]  (Sampling)
Chain 1: Iteration: 35 / 50 [ 70%]  (Sampling)
Chain 1: Iteration: 40 / 50 [ 80%]  (Sampling)
Chain 1: Iteration: 45 / 50 [ 90%]  (Sampling)
Chain 1: Iteration: 50 / 50 [100%]  (Sampling)
Chain 1: 
Chain 1:  Elapsed Time: 0.001 seconds (Warm-up)
Chain 1:                0.001 seconds (Sampling)
Chain 1:                0.002 seconds (Total)
Chain 1: 
Warning: The largest R-hat is 1.07, indicating chains have not mixed.
Running the chains for more iterations may help. See
https://mc-stan.org/misc/warnings.html#r-hat
Warning: Bulk Effective Samples Size (ESS) is too low, indicating posterior means and medians may be unreliable.
Running the chains for more iterations may help. See
https://mc-stan.org/misc/warnings.html#bulk-ess
Warning: Tail Effective Samples Size (ESS) is too low, indicating posterior variances and tail quantiles may be unreliable.
Running the chains for more iterations may help. See
https://mc-stan.org/misc/warnings.html#tail-ess
Warning: Some Pareto k diagnostic values are too high. See help('pareto-k-diagnostic') for details.

Warning: Some Pareto k diagnostic values are too high. See help('pareto-k-diagnostic') for details.

Error in loo::pareto_k_table(looic)["(0.7, 1]", "Count"] : 
  subscript out of bounds
Calls: find_regimes
Execution halted