R Under development (unstable) (2025-11-16 r89026 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.0107 secs elapsed) Iteration: 3 (30% completed; 0.01284 secs elapsed) Iteration: 4 (40% completed; 0.01474 secs elapsed) Iteration: 5 (50% completed; 0.01664 secs elapsed) Iteration: 6 (60% completed; 0.0187 secs elapsed) Iteration: 7 (70% completed; 0.0206 secs elapsed) Iteration: 8 (80% completed; 0.02257 secs elapsed) Iteration: 9 (90% completed; 0.02457 secs elapsed) Iteration: 10 (100% completed; 0.02663 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.00345 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.01232 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.01985 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.02768 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.03349 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.03915 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.04487 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.05061 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.05709 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.06431 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.00121 secs elapsed) Iteration: 3 (30% completed; 0.00281 secs elapsed) Iteration: 4 (40% completed; 0.00426 secs elapsed) Iteration: 5 (50% completed; 0.00571 secs elapsed) Iteration: 6 (60% completed; 0.00715 secs elapsed) Iteration: 7 (70% completed; 0.00858 secs elapsed) Iteration: 8 (80% completed; 0.01003 secs elapsed) Iteration: 9 (90% completed; 0.01145 secs elapsed) Iteration: 10 (100% completed; 0.01273 secs elapsed) Chain 2 Iteration: 2 (20% completed; 0.00116 secs elapsed) Iteration: 3 (30% completed; 0.00264 secs elapsed) Iteration: 4 (40% completed; 0.00404 secs elapsed) Iteration: 5 (50% completed; 0.00541 secs elapsed) Iteration: 6 (60% completed; 0.00681 secs elapsed) Iteration: 7 (70% completed; 0.0082 secs elapsed) Iteration: 8 (80% completed; 0.00954 secs elapsed) Iteration: 9 (90% completed; 0.01093 secs elapsed) Iteration: 10 (100% completed; 0.01228 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.00213 secs elapsed) Iteration: 5 (23.8% completed; 0.00651 secs elapsed) Iteration: 7 (33.3% completed; 0.01088 secs elapsed) Iteration: 9 (42.9% completed; 0.01512 secs elapsed) Iteration: 11 (52.4% completed; 0.01944 secs elapsed) Iteration: 13 (61.9% completed; 0.02375 secs elapsed) Iteration: 15 (71.4% completed; 0.02808 secs elapsed) Iteration: 17 (81% completed; 0.03236 secs elapsed) Iteration: 19 (90.5% completed; 0.03669 secs elapsed) Iteration: 21 (100% completed; 0.04113 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.00286 secs elapsed) Iteration: 5 (23.8% completed; 0.00731 secs elapsed) Iteration: 7 (33.3% completed; 0.01151 secs elapsed) Iteration: 9 (42.9% completed; 0.0158 secs elapsed) Iteration: 11 (52.4% completed; 0.02004 secs elapsed) Iteration: 13 (61.9% completed; 0.0243 secs elapsed) Iteration: 15 (71.4% completed; 0.02851 secs elapsed) Iteration: 17 (81% completed; 0.03293 secs elapsed) Iteration: 19 (90.5% completed; 0.03719 secs elapsed) Iteration: 21 (100% completed; 0.04141 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.00361 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.00888 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.01393 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.019 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.00351 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.00857 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.01364 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.01876 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.02382 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.00917 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.01457 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.02006 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.02537 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.03074 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.03668 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.04285 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.04848 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.05439 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.0602 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.85 0.54 7.39