R Under development (unstable) (2025-11-17 r89032 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. > cat("Testing parallel") Testing parallel> library(bkmrhat) Loading required package: coda Diagnostics and parallel chain functioning for Bayesian kernel machine regression > set.seed(111) > dat <- bkmr::SimData(n = 100, M = 4) > expit <- function(mu) 1/(1+exp(-mu)) > y <- rbinom(100, 1, expit(dat$y)) > Z <- dat$Z > X <- dat$X > set.seed(111) > > future::plan(strategy = future::sequential) > fitkm.list <- kmbayes_parallel(nchains=2, y = y, Z = Z, X = X, iter = 10, + verbose = FALSE, varsel = TRUE, family="binomial") Chain 1 Fitting probit regression model Iteration: 2 (20% completed; 0.00849 secs elapsed) Iteration: 3 (30% completed; 0.01431 secs elapsed) Iteration: 4 (40% completed; 0.02853 secs elapsed) Iteration: 5 (50% completed; 0.03448 secs elapsed) Iteration: 6 (60% completed; 0.04008 secs elapsed) Iteration: 7 (70% completed; 0.04566 secs elapsed) Iteration: 8 (80% completed; 0.05121 secs elapsed) Iteration: 9 (90% completed; 0.06404 secs elapsed) Iteration: 10 (100% completed; 0.06877 secs elapsed) Chain 2 Fitting probit regression model Iteration: 2 (20% completed; 0.00449 secs elapsed) Iteration: 3 (30% completed; 0.00919 secs elapsed) Iteration: 4 (40% completed; 0.01389 secs elapsed) Iteration: 5 (50% completed; 0.01864 secs elapsed) Iteration: 6 (60% completed; 0.02338 secs elapsed) Iteration: 7 (70% completed; 0.02864 secs elapsed) Iteration: 8 (80% completed; 0.03369 secs elapsed) Iteration: 9 (90% completed; 0.03911 secs elapsed) Iteration: 10 (100% completed; 0.04799 secs elapsed) Warning messages: 1: glm.fit: fitted probabilities numerically 0 or 1 occurred 2: glm.fit: fitted probabilities numerically 0 or 1 occurred > sinkit = kmbayes_diag(fitkm.list) Parallel chains Inference for the input samples (2 chains: each with iter = 10; warmup = 5): Q5 Q50 Q95 Mean SD Rhat Bulk_ESS Tail_ESS ystar1 2.1 3.3 6.1 3.7 1.6 1.52 10 10 ystar2 0.5 3.6 7.0 3.7 2.3 1.51 10 10 ystar3 0.8 2.9 5.0 3.0 1.5 1.26 10 10 ystar4 -6.4 -2.5 -1.1 -3.2 2.0 0.92 10 10 ystar5 0.3 1.1 2.6 1.2 0.8 1.25 10 10 ystar6 1.9 5.1 8.8 5.1 2.4 1.52 10 10 ystar7 5.9 8.6 10.9 8.6 1.9 0.89 10 10 ystar8 0.4 1.6 4.5 1.9 1.6 0.99 10 10 ystar9 0.2 1.7 3.7 1.8 1.4 1.32 10 10 ystar10 2.9 6.0 9.3 6.1 2.3 1.23 10 10 ystar11 0.5 1.5 4.0 1.9 1.3 3.61 10 10 ystar12 1.7 3.4 5.2 3.5 1.2 1.38 10 10 ystar13 0.8 1.8 4.3 2.1 1.3 2.01 10 10 ystar14 0.6 2.9 6.9 3.4 2.4 1.62 10 10 ystar15 0.7 4.6 7.9 4.4 2.7 1.04 10 10 ystar16 0.3 2.1 4.3 2.2 1.4 1.83 10 10 ystar17 0.5 4.3 7.2 3.8 2.7 1.62 10 10 ystar18 4.9 7.1 11.5 7.6 2.5 0.87 10 10 ystar19 -4.9 -2.7 -1.1 -2.9 1.6 1.48 10 10 ystar20 -5.2 -3.3 -2.3 -3.4 1.1 1.38 10 10 ystar21 1.4 3.9 5.1 3.6 1.5 1.38 10 10 ystar22 3.6 6.6 10.8 6.8 2.8 1.26 10 10 ystar23 4.0 5.4 10.2 6.3 2.4 2.90 10 10 ystar24 2.3 7.1 9.4 6.5 2.7 1.52 10 10 ystar25 3.6 5.8 7.7 5.7 1.6 1.34 10 10 ystar26 0.4 1.5 4.6 2.0 1.7 2.16 10 10 ystar27 -5.5 -4.1 -1.3 -3.7 1.7 0.96 10 10 ystar28 -10.8 -5.1 -2.8 -5.7 3.1 1.43 10 10 ystar29 -2.4 -0.7 -0.2 -1.0 0.9 1.26 10 10 ystar30 0.7 3.3 5.7 3.5 2.0 0.96 10 10 ystar31 -7.2 -4.7 -1.8 -4.6 2.1 1.83 10 10 ystar32 3.3 7.0 8.8 6.3 2.1 1.26 10 10 ystar33 0.7 2.3 3.9 2.2 1.3 1.69 10 10 ystar34 0.4 1.7 2.9 1.7 0.9 1.16 10 10 ystar35 -4.0 -1.3 -0.3 -1.7 1.4 1.32 10 10 ystar36 2.0 4.3 7.4 4.5 1.9 1.26 10 10 ystar37 2.1 3.1 4.2 3.1 0.8 1.05 10 10 ystar38 -4.9 -2.7 -0.5 -2.8 1.6 1.26 10 10 ystar39 1.1 2.5 5.6 2.8 1.6 2.90 10 10 ystar40 0.3 1.3 2.9 1.6 1.0 1.15 10 10 ystar41 -5.5 -3.2 -0.5 -3.1 1.8 1.38 10 10 ystar42 1.4 4.3 7.5 4.7 2.4 1.10 10 10 ystar43 0.2 1.1 3.5 1.5 1.4 1.32 10 10 ystar44 1.6 4.1 5.1 3.8 1.3 1.12 10 10 ystar45 1.4 3.8 6.7 3.8 2.0 3.61 10 10 ystar46 2.9 5.4 6.6 5.1 1.5 1.48 10 10 ystar47 1.5 4.0 7.2 4.1 2.1 1.69 10 10 ystar48 0.1 1.7 3.6 1.9 1.3 1.19 10 10 ystar49 -5.6 -3.1 -0.6 -3.2 2.1 1.04 10 10 ystar50 -5.6 -3.4 -1.1 -3.4 1.7 1.34 10 10 ystar51 0.9 2.2 5.0 2.6 1.5 1.56 10 10 ystar52 0.8 2.0 3.6 2.1 1.1 1.10 10 10 ystar53 -6.9 -3.7 -1.4 -4.0 2.0 1.22 10 10 ystar54 0.1 1.3 2.3 1.3 0.9 0.96 10 10 ystar55 5.2 7.8 11.5 8.1 2.4 1.62 10 10 ystar56 0.9 5.4 7.6 4.7 2.4 0.87 10 10 ystar57 -4.5 -2.3 -0.2 -2.4 1.5 2.90 10 10 ystar58 0.5 3.0 5.3 2.9 1.7 0.99 10 10 ystar59 0.2 2.3 4.7 2.3 1.9 1.69 10 10 ystar60 7.3 8.2 10.5 8.5 1.3 0.86 10 10 ystar61 -3.5 -1.2 -0.4 -1.6 1.1 1.48 10 10 ystar62 0.5 2.5 4.9 2.5 1.6 2.29 10 10 ystar63 3.4 4.1 8.4 5.1 2.1 1.69 10 10 ystar64 0.2 2.6 4.2 2.4 1.6 2.15 10 10 ystar65 0.0 1.2 3.8 1.6 1.4 1.52 10 10 ystar66 4.3 6.0 8.6 6.2 1.6 1.56 10 10 ystar67 0.6 1.7 3.9 2.0 1.2 1.21 10 10 ystar68 2.2 3.9 8.6 4.7 2.4 2.01 10 10 ystar69 1.0 2.7 4.6 2.6 1.4 0.99 10 10 ystar70 0.2 1.1 2.7 1.3 0.9 2.56 10 10 ystar71 2.7 5.1 8.1 5.2 2.0 1.52 10 10 ystar72 0.3 1.3 3.6 1.7 1.3 1.23 10 10 ystar73 0.4 2.6 5.1 2.8 1.7 1.22 10 10 ystar74 1.0 2.6 5.3 3.0 1.6 1.48 10 10 ystar75 3.2 5.3 9.7 5.9 2.3 1.52 10 10 ystar76 0.4 2.6 4.9 2.6 1.7 0.96 10 10 ystar77 1.6 4.8 7.5 4.8 2.2 2.01 10 10 ystar78 0.9 4.3 6.3 4.0 2.1 0.87 10 10 ystar79 1.4 3.4 7.1 3.9 2.1 1.62 10 10 ystar80 2.6 4.6 6.3 4.5 1.4 1.34 10 10 ystar81 1.8 3.5 6.6 3.7 1.8 0.90 10 10 ystar82 0.5 1.7 6.5 2.6 2.3 0.87 10 10 ystar83 -4.4 -1.6 -0.3 -2.2 1.6 0.96 10 10 ystar84 1.6 4.1 6.6 4.2 1.7 1.43 10 10 ystar85 3.9 6.7 10.4 6.9 2.3 0.96 10 10 ystar86 0.9 2.4 6.4 3.0 2.1 1.52 10 10 ystar87 1.3 2.5 4.3 2.7 1.1 0.90 10 10 ystar88 1.8 3.8 5.8 3.7 1.5 1.35 10 10 ystar89 0.3 2.5 6.8 2.8 2.4 1.26 10 10 ystar90 0.1 1.6 2.3 1.3 0.8 1.38 10 10 ystar91 0.2 1.4 3.2 1.4 1.2 1.75 10 10 ystar92 2.5 3.7 6.1 4.1 1.4 2.29 10 10 ystar93 -3.8 -2.1 -0.8 -2.3 1.1 1.02 10 10 ystar94 -3.0 -1.5 -0.3 -1.4 1.0 1.05 10 10 ystar95 2.9 5.9 8.3 5.9 2.1 1.32 10 10 ystar96 1.7 4.8 7.2 4.8 2.0 1.19 10 10 ystar97 2.9 4.4 6.3 4.7 1.3 1.62 10 10 ystar98 2.2 4.7 8.0 5.3 2.2 1.52 10 10 ystar99 1.1 2.7 5.4 3.0 1.7 1.10 10 10 ystar100 0.3 1.5 3.6 1.7 1.3 2.36 10 10 beta 1.1 1.2 1.6 1.3 0.2 1.30 10 10 lambda 3.4 4.7 7.4 5.0 1.8 1.00 10 10 r1 1.0 1.1 1.1 1.1 0.1 1.00 10 10 r2 1.0 1.0 1.0 1.0 0.0 2.41 10 10 r3 1.0 1.0 1.0 1.0 0.0 1.00 10 10 r4 1.0 1.0 1.0 1.0 0.0 1.00 10 10 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). > xx = comb_bkmrfits(fitkm.list) > sinkit = suppressWarnings(predict(xx)) > sinkit = suppressWarnings(predict(xx, ptype="sd.fit")) > > closeAllConnections() > > proc.time() user system elapsed 6.23 0.43 6.60