data(dommats, package = "EloRating")
# using small numbers for iterations etc to speed up running time
res <- elo_steepness_from_matrix(dommats$elephants, n_rand = 1, cores = 2,
iter = 800, warmup = 300,
refresh = 0, chains = 2, seed = 1)
plot_steepness(res)
# \donttest{
# use the original underlying algorithm by Goffe et al 2018
# will warn about divergent iterations and low effective sample sizes
# but warnings can be caught/suppressed by setting silent = TRUE
res <- elo_steepness_from_matrix(dommats$elephants, n_rand = 1,
algo = "original", silent = TRUE,
iter = 1000, warmup = 500, refresh = 0)
res$diagnostics
# or the sampling can be tweaked to achieve better convergence:
# (this still might produce some divergent transitions on occasion)
# (and the number of iterations should be set higher)
res <- elo_steepness_from_matrix(dommats$elephants, n_rand = 1, chains = 2,
algo = "original", silent = TRUE, seed = 1,
iter = 1000, warmup = 500, refresh = 0,
control = list(adapt_delta = 0.99))
res$diagnostics
# }
Run the code above in your browser using DataLab