R Under development (unstable) (2025-11-18 r89035 ucrt) -- "Unsuffered Consequences" Copyright (C) 2025 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library(bkmrhat) Loading required package: coda Diagnostics and parallel chain functioning for Bayesian kernel machine regression > > set.seed(111) > dat <- bkmr::SimData(n = 50, M = 5, ind=1:3, Zgen="realistic") > y <- dat$y > Z <- dat$Z > X <- cbind(dat$X, rnorm(50)) > > # run 10 initial iterations for a model with only 2 exposures > Z2 = Z > kmfitbma.start <- suppressWarnings(bkmr::kmbayes(y = y, Z = Z2, X = X, iter = 10, verbose = FALSE, varsel = TRUE, est.h = TRUE)) Iteration: 2 (20% completed; 0.01203 secs elapsed) Iteration: 3 (30% completed; 0.01424 secs elapsed) Iteration: 4 (40% completed; 0.01618 secs elapsed) Iteration: 5 (50% completed; 0.01811 secs elapsed) Iteration: 6 (60% completed; 0.02002 secs elapsed) Iteration: 7 (70% completed; 0.02192 secs elapsed) Iteration: 8 (80% completed; 0.02384 secs elapsed) Iteration: 9 (90% completed; 0.0258 secs elapsed) Iteration: 10 (100% completed; 0.02778 secs elapsed) > > # run 20 additional iterations > moreiterations = suppressWarnings(kmbayes_continue(kmfitbma.start, iter=20)) Validating control.params... Validating starting.values... Iteration: 3 (14.3% completed; 0.00333 secs elapsed) Acceptance rates for Metropolis-Hastings algorithm: param rate 1 lambda 0.5 2 r/delta (overall) 0.5 3 r/delta (move 1) 0.5 4 r/delta (move 2) NaN Iteration: 5 (23.8% completed; 0.01165 secs elapsed) Acceptance rates for Metropolis-Hastings algorithm: param rate 1 lambda 0.5 2 r/delta (overall) 0.5 3 r/delta (move 1) 0.5 4 r/delta (move 2) NaN Iteration: 7 (33.3% completed; 0.01881 secs elapsed) Acceptance rates for Metropolis-Hastings algorithm: param rate 1 lambda 0.6666667 2 r/delta (overall) 0.5000000 3 r/delta (move 1) 0.4000000 4 r/delta (move 2) 1.0000000 Iteration: 9 (42.9% completed; 0.02587 secs elapsed) Acceptance rates for Metropolis-Hastings algorithm: param rate 1 lambda 0.6250000 2 r/delta (overall) 0.5000000 3 r/delta (move 1) 0.3333333 4 r/delta (move 2) 1.0000000 Iteration: 11 (52.4% completed; 0.03141 secs elapsed) Acceptance rates for Metropolis-Hastings algorithm: param rate 1 lambda 0.6 2 r/delta (overall) 0.6 3 r/delta (move 1) 0.5 4 r/delta (move 2) 1.0 Iteration: 13 (61.9% completed; 0.03688 secs elapsed) Acceptance rates for Metropolis-Hastings algorithm: param rate 1 lambda 0.5833333 2 r/delta (overall) 0.5833333 3 r/delta (move 1) 0.5555556 4 r/delta (move 2) 0.6666667 Iteration: 15 (71.4% completed; 0.04242 secs elapsed) Acceptance rates for Metropolis-Hastings algorithm: param rate 1 lambda 0.5714286 2 r/delta (overall) 0.5000000 3 r/delta (move 1) 0.5000000 4 r/delta (move 2) 0.5000000 Iteration: 17 (81% completed; 0.04805 secs elapsed) Acceptance rates for Metropolis-Hastings algorithm: param rate 1 lambda 0.5625000 2 r/delta (overall) 0.5625000 3 r/delta (move 1) 0.5000000 4 r/delta (move 2) 0.6666667 Iteration: 19 (90.5% completed; 0.05437 secs elapsed) Acceptance rates for Metropolis-Hastings algorithm: param rate 1 lambda 0.5000000 2 r/delta (overall) 0.5555556 3 r/delta (move 1) 0.5454545 4 r/delta (move 2) 0.5714286 Iteration: 21 (100% completed; 0.06154 secs elapsed) Acceptance rates for Metropolis-Hastings algorithm: param rate 1 lambda 0.450 2 r/delta (overall) 0.550 3 r/delta (move 1) 0.500 4 r/delta (move 2) 0.625 > res = kmbayes_diag(moreiterations) Single chain Inference for the input samples (1 chains: each with iter = 30; warmup = 15): Q5 Q50 Q95 Mean SD Rhat Bulk_ESS Tail_ESS h.hat1 1.9 2.1 2.4 2.1 0.2 0.95 14 15 h.hat2 2.3 2.7 2.9 2.7 0.2 0.93 16 15 h.hat3 2.3 2.5 2.8 2.5 0.2 1.11 16 15 h.hat4 2.5 2.9 3.7 3.1 0.5 0.94 16 15 h.hat5 2.0 2.1 2.5 2.2 0.2 1.14 16 15 h.hat6 1.2 1.5 1.9 1.5 0.2 1.21 7 15 h.hat7 3.3 3.6 4.1 3.7 0.3 1.00 16 15 h.hat8 3.5 3.7 4.2 3.8 0.3 1.06 16 15 h.hat9 2.5 2.9 3.4 2.9 0.3 1.00 11 15 h.hat10 2.5 2.8 3.1 2.8 0.2 0.95 16 15 h.hat11 2.3 2.6 3.1 2.7 0.3 0.93 10 15 h.hat12 2.3 2.6 2.9 2.6 0.2 0.94 16 15 h.hat13 0.5 1.0 1.6 1.0 0.4 1.03 11 15 h.hat14 1.5 1.8 2.0 1.8 0.2 1.03 16 15 h.hat15 1.1 1.4 1.7 1.4 0.2 1.11 9 15 h.hat16 3.0 3.4 3.7 3.4 0.3 1.03 16 16 h.hat17 1.8 2.1 2.3 2.1 0.2 1.13 14 16 h.hat18 1.7 1.9 2.2 1.9 0.2 1.17 10 16 h.hat19 3.5 3.8 4.3 3.8 0.3 0.98 16 15 h.hat20 1.7 1.9 2.2 1.9 0.2 0.98 16 15 h.hat21 1.9 2.1 2.4 2.1 0.2 0.95 16 15 h.hat22 1.8 2.2 2.7 2.2 0.3 0.95 14 15 h.hat23 1.4 1.6 2.0 1.6 0.2 1.16 8 15 h.hat24 2.4 2.8 3.3 2.8 0.3 0.94 10 15 h.hat25 1.6 1.8 2.2 1.9 0.2 1.10 16 16 h.hat26 1.3 1.6 1.9 1.6 0.2 1.08 10 15 h.hat27 3.4 3.9 5.0 4.1 0.5 1.10 16 15 h.hat28 0.1 0.6 1.1 0.7 0.4 1.08 11 15 h.hat29 2.3 2.5 2.9 2.5 0.2 0.95 16 15 h.hat30 3.2 3.5 3.9 3.5 0.2 1.02 16 16 h.hat31 2.8 3.2 3.7 3.2 0.3 0.94 16 15 h.hat32 2.7 3.0 3.3 2.9 0.2 1.24 13 15 h.hat33 0.5 1.0 1.5 1.0 0.3 0.98 16 15 h.hat34 2.8 3.2 3.5 3.2 0.3 1.23 16 15 h.hat35 3.5 3.9 4.3 3.9 0.3 1.13 16 15 h.hat36 0.8 1.3 1.7 1.3 0.3 0.94 16 15 h.hat37 1.6 1.8 2.2 1.8 0.2 1.21 9 15 h.hat38 0.9 1.3 1.6 1.3 0.3 1.08 11 15 h.hat39 2.2 2.4 2.7 2.4 0.2 1.11 16 15 h.hat40 3.1 3.5 3.8 3.5 0.3 1.00 16 16 h.hat41 3.5 3.6 4.0 3.7 0.2 1.00 16 15 h.hat42 3.2 3.5 3.9 3.5 0.2 0.99 16 15 h.hat43 2.4 2.8 3.0 2.8 0.2 0.94 16 16 h.hat44 1.3 1.6 1.9 1.6 0.2 1.03 15 15 h.hat45 1.0 1.4 1.8 1.4 0.2 0.96 10 15 h.hat46 1.6 1.8 2.1 1.8 0.2 1.04 16 15 h.hat47 1.8 2.1 2.6 2.1 0.3 1.01 16 15 h.hat48 1.2 1.5 1.8 1.5 0.2 1.04 12 15 h.hat49 -0.2 0.5 1.0 0.5 0.4 0.95 14 15 h.hat50 0.2 0.7 1.1 0.7 0.3 1.02 14 15 beta1 1.9 2.0 2.0 1.9 0.0 1.02 11 15 beta2 -0.1 0.0 0.2 0.1 0.1 0.93 16 16 lambda 4.5 6.3 8.2 6.1 1.5 2.36 4 4 r1 0.0 0.0 0.0 0.0 0.0 1.00 16 16 r2 0.9 0.9 1.1 1.0 0.1 1.14 9 5 r3 0.0 0.0 0.0 0.0 0.0 1.00 15 15 r4 0.0 0.0 0.0 0.0 0.0 0.93 8 15 r5 0.0 0.0 0.0 0.0 0.0 1.00 15 15 sigsq.eps 0.3 0.4 0.5 0.4 0.1 1.08 16 16 For each parameter, Bulk_ESS and Tail_ESS are crude measures of effective sample size for bulk and tail quantities respectively (an ESS > 100 per chain is considered good), and Rhat is the potential scale reduction factor on rank normalized split chains (at convergence, Rhat <= 1.05). > > #bkmr::TracePlot(moreiterations, par="r", comp=5) > #bkmr::TracePlot(moreiterations, par="beta", comp=1) > #bkmr::TracePlot(moreiterations, par="h", comp=50) > > > stopifnot(kmfitbma.start$iter stopifnot(all(kmfitbma.start$sigsq.eps %in% moreiterations$sigsq.eps)) > stopifnot(all(kmfitbma.start$beta[,1] %in% moreiterations$beta[,1])) > stopifnot(all(kmfitbma.start$r[,1] %in% moreiterations$r[,1])) > stopifnot(all(kmfitbma.start$h.hat[,1] %in% moreiterations$h.hat[,1])) > stopifnot(ncol(kmfitbma.start$beta) == ncol(moreiterations$beta)) > stopifnot(ncol(kmfitbma.start$r) == ncol(moreiterations$r)) > stopifnot(ncol(kmfitbma.start$h.hat) == ncol(moreiterations$h.hat)) > > > # now in paralelel > kmfitbma.start2 <- suppressWarnings(kmbayes_parallel(nchains=2,y = y, Z = Z2, X = X, iter = 10, verbose = FALSE, varsel = TRUE, est.h = FALSE)) Chain 1 Iteration: 2 (20% completed; 0.00114 secs elapsed) Iteration: 3 (30% completed; 0.0027 secs elapsed) Iteration: 4 (40% completed; 0.00409 secs elapsed) Iteration: 5 (50% completed; 0.0055 secs elapsed) Iteration: 6 (60% completed; 0.0069 secs elapsed) Iteration: 7 (70% completed; 0.00831 secs elapsed) Iteration: 8 (80% completed; 0.0097 secs elapsed) Iteration: 9 (90% completed; 0.01107 secs elapsed) Iteration: 10 (100% completed; 0.01233 secs elapsed) Chain 2 Iteration: 2 (20% completed; 0.00111 secs elapsed) Iteration: 3 (30% completed; 0.00256 secs elapsed) Iteration: 4 (40% completed; 0.00394 secs elapsed) Iteration: 5 (50% completed; 0.00532 secs elapsed) Iteration: 6 (60% completed; 0.0067 secs elapsed) Iteration: 7 (70% completed; 0.00808 secs elapsed) Iteration: 8 (80% completed; 0.00943 secs elapsed) Iteration: 9 (90% completed; 0.01079 secs elapsed) Iteration: 10 (100% completed; 0.01235 secs elapsed) > > # run 20 additional iterations > moreiterations2 = suppressWarnings(kmbayes_parallel_continue(kmfitbma.start2, iter=20)) Chain 1 Acceptance rates for Metropolis-Hastings algorithm: param rate 1 lambda 0 2 r/delta (overall) 1 3 r/delta (move 1) 1 4 r/delta (move 2) NaN Acceptance rates for Metropolis-Hastings algorithm: param rate 1 lambda 0.5000000 2 r/delta (overall) 0.5000000 3 r/delta (move 1) 0.6666667 4 r/delta (move 2) 0.0000000 Acceptance rates for Metropolis-Hastings algorithm: param rate 1 lambda 0.3333333 2 r/delta (overall) 0.6666667 3 r/delta (move 1) 0.8000000 4 r/delta (move 2) 0.0000000 Acceptance rates for Metropolis-Hastings algorithm: param rate 1 lambda 0.25 2 r/delta (overall) 0.50 3 r/delta (move 1) 0.80 4 r/delta (move 2) 0.00 Acceptance rates for Metropolis-Hastings algorithm: param rate 1 lambda 0.2 2 r/delta (overall) 0.4 3 r/delta (move 1) 0.8 4 r/delta (move 2) 0.0 Acceptance rates for Metropolis-Hastings algorithm: param rate 1 lambda 0.2500000 2 r/delta (overall) 0.4166667 3 r/delta (move 1) 0.7142857 4 r/delta (move 2) 0.0000000 Acceptance rates for Metropolis-Hastings algorithm: param rate 1 lambda 0.3571429 2 r/delta (overall) 0.4285714 3 r/delta (move 1) 0.6666667 4 r/delta (move 2) 0.0000000 Acceptance rates for Metropolis-Hastings algorithm: param rate 1 lambda 0.3125000 2 r/delta (overall) 0.3750000 3 r/delta (move 1) 0.6666667 4 r/delta (move 2) 0.0000000 Acceptance rates for Metropolis-Hastings algorithm: param rate 1 lambda 0.3333333 2 r/delta (overall) 0.3888889 3 r/delta (move 1) 0.7000000 4 r/delta (move 2) 0.0000000 Acceptance rates for Metropolis-Hastings algorithm: param rate 1 lambda 0.35 2 r/delta (overall) 0.40 3 r/delta (move 1) 0.70 4 r/delta (move 2) 0.10 Validating control.params... Validating starting.values... Iteration: 3 (14.3% completed; 0.00216 secs elapsed) Iteration: 5 (23.8% completed; 0.00659 secs elapsed) Iteration: 7 (33.3% completed; 0.01089 secs elapsed) Iteration: 9 (42.9% completed; 0.01521 secs elapsed) Iteration: 11 (52.4% completed; 0.01953 secs elapsed) Iteration: 13 (61.9% completed; 0.0238 secs elapsed) Iteration: 15 (71.4% completed; 0.02832 secs elapsed) Iteration: 17 (81% completed; 0.03266 secs elapsed) Iteration: 19 (90.5% completed; 0.03693 secs elapsed) Iteration: 21 (100% completed; 0.04125 secs elapsed) Chain 2 Acceptance rates for Metropolis-Hastings algorithm: param rate 1 lambda 0.5 2 r/delta (overall) 1.0 3 r/delta (move 1) 1.0 4 r/delta (move 2) 1.0 Acceptance rates for Metropolis-Hastings algorithm: param rate 1 lambda 0.25 2 r/delta (overall) 1.00 3 r/delta (move 1) 1.00 4 r/delta (move 2) 1.00 Acceptance rates for Metropolis-Hastings algorithm: param rate 1 lambda 0.3333333 2 r/delta (overall) 1.0000000 3 r/delta (move 1) 1.0000000 4 r/delta (move 2) 1.0000000 Acceptance rates for Metropolis-Hastings algorithm: param rate 1 lambda 0.375 2 r/delta (overall) 0.875 3 r/delta (move 1) 0.800 4 r/delta (move 2) 1.000 Acceptance rates for Metropolis-Hastings algorithm: param rate 1 lambda 0.4000000 2 r/delta (overall) 0.9000000 3 r/delta (move 1) 0.8571429 4 r/delta (move 2) 1.0000000 Acceptance rates for Metropolis-Hastings algorithm: param rate 1 lambda 0.3333333 2 r/delta (overall) 0.9166667 3 r/delta (move 1) 0.8888889 4 r/delta (move 2) 1.0000000 Acceptance rates for Metropolis-Hastings algorithm: param rate 1 lambda 0.2857143 2 r/delta (overall) 0.9285714 3 r/delta (move 1) 0.9000000 4 r/delta (move 2) 1.0000000 Acceptance rates for Metropolis-Hastings algorithm: param rate 1 lambda 0.3125000 2 r/delta (overall) 0.9375000 3 r/delta (move 1) 0.9090909 4 r/delta (move 2) 1.0000000 Acceptance rates for Metropolis-Hastings algorithm: param rate 1 lambda 0.3333333 2 r/delta (overall) 0.8888889 3 r/delta (move 1) 0.9166667 4 r/delta (move 2) 0.8333333 Acceptance rates for Metropolis-Hastings algorithm: param rate 1 lambda 0.3500000 2 r/delta (overall) 0.8500000 3 r/delta (move 1) 0.9230769 4 r/delta (move 2) 0.7142857 Validating control.params... Validating starting.values... Iteration: 3 (14.3% completed; 0.00223 secs elapsed) Iteration: 5 (23.8% completed; 0.00669 secs elapsed) Iteration: 7 (33.3% completed; 0.01092 secs elapsed) Iteration: 9 (42.9% completed; 0.01519 secs elapsed) Iteration: 11 (52.4% completed; 0.01942 secs elapsed) Iteration: 13 (61.9% completed; 0.0239 secs elapsed) Iteration: 15 (71.4% completed; 0.02808 secs elapsed) Iteration: 17 (81% completed; 0.03227 secs elapsed) Iteration: 19 (90.5% completed; 0.03653 secs elapsed) Iteration: 21 (100% completed; 0.04077 secs elapsed) > res2 = kmbayes_diag(moreiterations2) Parallel chains Inference for the input samples (2 chains: each with iter = 30; warmup = 15): Q5 Q50 Q95 Mean SD Rhat Bulk_ESS Tail_ESS beta1 1.9 2.0 2.0 2.0 0.1 1.03 23 14 beta2 -0.1 0.1 0.2 0.1 0.1 1.06 23 41 lambda 5.3 8.2 13.3 9.2 3.2 1.10 15 13 r1 0.0 0.0 0.0 0.0 0.0 4.23 10 30 r2 0.0 0.0 1.2 0.1 0.4 1.68 9 30 r3 0.0 0.0 1.0 0.3 0.5 2.31 8 30 r4 0.0 0.0 0.0 0.0 0.0 2.44 10 30 r5 0.0 0.0 0.0 0.0 0.1 1.29 13 11 sigsq.eps 0.3 0.4 0.5 0.4 0.1 1.35 13 28 For each parameter, Bulk_ESS and Tail_ESS are crude measures of effective sample size for bulk and tail quantities respectively (an ESS > 100 per chain is considered good), and Rhat is the potential scale reduction factor on rank normalized split chains (at convergence, Rhat <= 1.05). > > > stopifnot(kmfitbma.start2[[1]]$iter < moreiterations2[[1]]$iter) > stopifnot(all(kmfitbma.start2[[1]]$sigsq.eps %in% moreiterations2[[1]]$sigsq.eps)) > stopifnot(all(kmfitbma.start2[[1]]$beta[,1] %in% moreiterations2[[1]]$beta[,1])) > stopifnot(all(kmfitbma.start2[[1]]$r[,1] %in% moreiterations2[[1]]$r[,1])) > stopifnot(all(kmfitbma.start2[[1]]$h.hat[,1] %in% moreiterations2[[1]]$h.hat[,1])) > stopifnot(ncol(kmfitbma.start2[[1]]$beta) == ncol(moreiterations2[[1]]$beta)) > stopifnot(ncol(kmfitbma.start2[[1]]$r) == ncol(moreiterations2[[1]]$r)) > stopifnot(ncol(kmfitbma.start2[[1]]$h.hat) == ncol(moreiterations2[[1]]$h.hat)) > > > # just see if it will work with probit model > y <- 1.0*(dat$y>median(dat$y)) > fitty1 = suppressWarnings(bkmr::kmbayes(y=y,Z=Z,X=X, est.h=TRUE, iter=5, family="binomial")) Fitting probit regression model Iteration: 2 (40% completed; 0.0035 secs elapsed) Acceptance rates for Metropolis-Hastings algorithm: param rate 1 lambda 0 2 r1 0 3 r2 1 4 r3 1 5 r4 0 6 r5 0 Iteration: 3 (60% completed; 0.00858 secs elapsed) Acceptance rates for Metropolis-Hastings algorithm: param rate 1 lambda 0.5 2 r1 0.5 3 r2 0.5 4 r3 0.5 5 r4 0.5 6 r5 0.0 Iteration: 4 (80% completed; 0.01357 secs elapsed) Acceptance rates for Metropolis-Hastings algorithm: param rate 1 lambda 0.3333333 2 r1 0.6666667 3 r2 0.3333333 4 r3 0.3333333 5 r4 0.6666667 6 r5 0.3333333 Iteration: 5 (100% completed; 0.0217 secs elapsed) Acceptance rates for Metropolis-Hastings algorithm: param rate 1 lambda 0.50 2 r1 0.75 3 r2 0.50 4 r3 0.50 5 r4 0.75 6 r5 0.50 > # do some diagnostics here to see if 1000 iterations (default) is enough > # add 3000 additional iterations > fitty2 = suppressWarnings(kmbayes_continue(fitty1, iter=5)) Fitting probit regression model Validating control.params... Validating starting.values... Iteration: 2 (33.3% completed; 0.00413 secs elapsed) Acceptance rates for Metropolis-Hastings algorithm: param rate 1 lambda 0 2 r1 1 3 r2 1 4 r3 1 5 r4 0 6 r5 0 Iteration: 3 (50% completed; 0.00984 secs elapsed) Acceptance rates for Metropolis-Hastings algorithm: param rate 1 lambda 0.5 2 r1 1.0 3 r2 1.0 4 r3 1.0 5 r4 0.5 6 r5 0.5 Iteration: 4 (66.7% completed; 0.01538 secs elapsed) Acceptance rates for Metropolis-Hastings algorithm: param rate 1 lambda 0.3333333 2 r1 1.0000000 3 r2 1.0000000 4 r3 0.6666667 5 r4 0.6666667 6 r5 0.3333333 Iteration: 5 (83.3% completed; 0.02102 secs elapsed) Acceptance rates for Metropolis-Hastings algorithm: param rate 1 lambda 0.25 2 r1 1.00 3 r2 1.00 4 r3 0.75 5 r4 0.50 6 r5 0.50 Iteration: 6 (100% completed; 0.02657 secs elapsed) Acceptance rates for Metropolis-Hastings algorithm: param rate 1 lambda 0.2 2 r1 1.0 3 r2 0.8 4 r3 0.8 5 r4 0.6 6 r5 0.6 > stopifnot(ncol(fitty1$ystar[,1]) %in% ncol(fitty2$ystar[,1])) > > > > # force old version > kmfitbma.start2 = kmfitbma.start > kmfitbma.start2$delta = kmfitbma.start2$delta*0 > moreiterations = suppressWarnings(kmbayes_continue(kmfitbma.start2, iter=20)) Validating control.params... Validating starting.values... Iteration: 3 (14.3% completed; 0.01505 secs elapsed) Acceptance rates for Metropolis-Hastings algorithm: param rate 1 lambda 1.0 2 r/delta (overall) 0.5 3 r/delta (move 1) 1.0 4 r/delta (move 2) 0.0 Iteration: 5 (23.8% completed; 0.02088 secs elapsed) Acceptance rates for Metropolis-Hastings algorithm: param rate 1 lambda 1.00 2 r/delta (overall) 0.75 3 r/delta (move 1) 1.00 4 r/delta (move 2) 0.00 Iteration: 7 (33.3% completed; 0.02675 secs elapsed) Acceptance rates for Metropolis-Hastings algorithm: param rate 1 lambda 0.8333333 2 r/delta (overall) 0.5000000 3 r/delta (move 1) 0.6000000 4 r/delta (move 2) 0.0000000 Iteration: 9 (42.9% completed; 0.03256 secs elapsed) Acceptance rates for Metropolis-Hastings algorithm: param rate 1 lambda 0.7500000 2 r/delta (overall) 0.5000000 3 r/delta (move 1) 0.6666667 4 r/delta (move 2) 0.0000000 Iteration: 11 (52.4% completed; 0.03876 secs elapsed) Acceptance rates for Metropolis-Hastings algorithm: param rate 1 lambda 0.7000000 2 r/delta (overall) 0.4000000 3 r/delta (move 1) 0.6666667 4 r/delta (move 2) 0.0000000 Iteration: 13 (61.9% completed; 0.04518 secs elapsed) Acceptance rates for Metropolis-Hastings algorithm: param rate 1 lambda 0.6666667 2 r/delta (overall) 0.4166667 3 r/delta (move 1) 0.6666667 4 r/delta (move 2) 0.1666667 Iteration: 15 (71.4% completed; 0.0512 secs elapsed) Acceptance rates for Metropolis-Hastings algorithm: param rate 1 lambda 0.7142857 2 r/delta (overall) 0.3571429 3 r/delta (move 1) 0.6666667 4 r/delta (move 2) 0.1250000 Iteration: 17 (81% completed; 0.05828 secs elapsed) Acceptance rates for Metropolis-Hastings algorithm: param rate 1 lambda 0.6875000 2 r/delta (overall) 0.3125000 3 r/delta (move 1) 0.6666667 4 r/delta (move 2) 0.1000000 Iteration: 19 (90.5% completed; 0.06477 secs elapsed) Acceptance rates for Metropolis-Hastings algorithm: param rate 1 lambda 0.7222222 2 r/delta (overall) 0.2777778 3 r/delta (move 1) 0.5000000 4 r/delta (move 2) 0.1000000 Iteration: 21 (100% completed; 0.07071 secs elapsed) Acceptance rates for Metropolis-Hastings algorithm: param rate 1 lambda 0.65000000 2 r/delta (overall) 0.25000000 3 r/delta (move 1) 0.44444444 4 r/delta (move 2) 0.09090909 > res = kmbayes_diag(moreiterations) Single chain Inference for the input samples (1 chains: each with iter = 30; warmup = 15): Q5 Q50 Q95 Mean SD Rhat Bulk_ESS Tail_ESS h.hat1 2.0 2.1 2.4 2.2 0.2 0.96 16 16 h.hat2 1.9 2.1 2.5 2.2 0.2 0.95 16 16 h.hat3 2.1 2.3 2.5 2.3 0.1 1.02 16 15 h.hat4 3.2 3.9 4.3 3.9 0.4 1.38 6 15 h.hat5 1.9 2.2 2.5 2.2 0.2 0.98 16 15 h.hat6 1.8 2.1 2.4 2.1 0.2 1.03 16 15 h.hat7 2.8 3.3 3.7 3.3 0.3 0.98 16 15 h.hat8 2.6 3.0 3.5 3.0 0.3 0.95 16 15 h.hat9 2.6 2.9 3.2 2.9 0.2 0.94 16 16 h.hat10 2.7 2.9 3.0 2.9 0.1 1.19 9 15 h.hat11 2.5 2.6 3.0 2.7 0.2 1.04 16 16 h.hat12 2.0 2.2 2.4 2.2 0.2 0.93 16 15 h.hat13 0.5 0.7 1.0 0.7 0.2 0.96 16 16 h.hat14 1.5 1.8 1.9 1.7 0.2 0.99 16 15 h.hat15 1.1 1.3 1.6 1.4 0.2 0.97 16 16 h.hat16 3.2 3.6 3.8 3.5 0.2 0.93 16 16 h.hat17 2.2 2.3 2.5 2.3 0.1 0.96 16 15 h.hat18 2.3 2.6 2.9 2.6 0.2 0.93 16 15 h.hat19 3.4 3.5 3.8 3.6 0.1 1.04 11 15 h.hat20 1.4 1.7 1.9 1.7 0.2 1.00 16 15 h.hat21 1.7 2.0 2.2 2.0 0.2 1.02 16 15 h.hat22 1.9 2.3 2.4 2.2 0.2 1.17 16 16 h.hat23 1.9 2.1 2.4 2.1 0.2 0.98 16 15 h.hat24 2.6 2.8 3.0 2.8 0.2 1.01 16 16 h.hat25 1.7 2.1 2.4 2.0 0.3 0.93 16 16 h.hat26 1.4 1.6 1.7 1.6 0.1 0.97 16 16 h.hat27 3.6 3.9 4.2 3.9 0.2 1.04 16 15 h.hat28 0.1 0.5 0.9 0.5 0.3 1.05 16 15 h.hat29 2.0 2.3 2.5 2.3 0.2 1.07 16 15 h.hat30 3.1 3.3 3.5 3.3 0.2 0.99 14 15 h.hat31 3.4 3.9 4.6 3.9 0.4 1.23 10 16 h.hat32 2.9 3.2 3.4 3.2 0.2 1.08 13 16 h.hat33 0.5 0.7 1.0 0.8 0.2 0.97 16 16 h.hat34 3.0 3.4 3.7 3.3 0.2 0.94 16 16 h.hat35 3.3 3.8 4.2 3.8 0.4 0.95 16 16 h.hat36 0.8 1.1 1.3 1.1 0.2 0.98 16 16 h.hat37 2.0 2.4 2.6 2.3 0.2 1.03 12 16 h.hat38 1.4 1.8 2.2 1.8 0.3 0.95 16 15 h.hat39 2.3 2.5 2.9 2.5 0.2 0.93 16 16 h.hat40 3.0 3.3 3.6 3.3 0.2 1.21 16 15 h.hat41 2.6 2.8 3.5 3.0 0.3 0.93 16 15 h.hat42 3.2 3.3 3.5 3.3 0.1 0.96 15 15 h.hat43 2.8 3.4 3.6 3.3 0.3 1.19 16 16 h.hat44 1.5 1.7 1.8 1.7 0.1 0.95 16 16 h.hat45 1.2 1.5 1.8 1.5 0.2 0.93 16 16 h.hat46 2.1 2.4 2.8 2.4 0.2 0.99 16 15 h.hat47 1.5 1.9 2.2 1.9 0.2 1.46 16 16 h.hat48 1.5 1.8 2.0 1.8 0.2 1.02 16 16 h.hat49 -0.1 0.5 0.7 0.4 0.3 1.17 9 15 h.hat50 0.2 0.7 1.0 0.6 0.3 1.04 14 15 beta1 1.9 2.0 2.0 2.0 0.0 1.11 16 15 beta2 0.0 0.1 0.3 0.1 0.1 1.13 16 16 lambda 9.9 11.1 23.5 14.0 5.0 1.36 5 15 r1 0.0 0.0 0.0 0.0 0.0 1.00 15 15 r2 0.0 0.0 0.0 0.0 0.0 2.45 4 15 r3 0.0 0.0 0.0 0.0 0.0 1.00 15 15 r4 0.0 0.0 0.0 0.0 0.0 1.00 15 15 r5 0.0 0.0 0.0 0.0 0.0 1.00 15 15 sigsq.eps 0.2 0.4 0.5 0.4 0.1 0.93 16 15 For each parameter, Bulk_ESS and Tail_ESS are crude measures of effective sample size for bulk and tail quantities respectively (an ESS > 100 per chain is considered good), and Rhat is the potential scale reduction factor on rank normalized split chains (at convergence, Rhat <= 1.05). > > proc.time() user system elapsed 6.48 0.57 7.04