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 for non duplicated results in seeded simulations") Testing for non duplicated results in seeded simulations> > 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 = 4) > y <- dat$y > Z <- dat$Z > X <- dat$X > > future::plan(strategy = future::sequential) > fitkm.list <- kmbayes_parallel(nchains=2, y = y, Z = Z, X = X, iter = 10, + verbose = FALSE, varsel = TRUE) Chain 1 Iteration: 2 (20% completed; 0.00223 secs elapsed) Iteration: 3 (30% completed; 0.01215 secs elapsed) Iteration: 4 (40% completed; 0.01369 secs elapsed) Iteration: 5 (50% completed; 0.01522 secs elapsed) Iteration: 6 (60% completed; 0.01671 secs elapsed) Iteration: 7 (70% completed; 0.01816 secs elapsed) Iteration: 8 (80% completed; 0.01965 secs elapsed) Iteration: 9 (90% completed; 0.02108 secs elapsed) Iteration: 10 (100% completed; 0.02254 secs elapsed) Chain 2 Iteration: 2 (20% completed; 0.00133 secs elapsed) Iteration: 3 (30% completed; 0.00281 secs elapsed) Iteration: 4 (40% completed; 0.00432 secs elapsed) Iteration: 5 (50% completed; 0.00578 secs elapsed) Iteration: 6 (60% completed; 0.0072 secs elapsed) Iteration: 7 (70% completed; 0.00867 secs elapsed) Iteration: 8 (80% completed; 0.01016 secs elapsed) Iteration: 9 (90% completed; 0.01158 secs elapsed) Iteration: 10 (100% completed; 0.01302 secs elapsed) > > rr = as.mcmc.list(fitkm.list) > tt = all.equal(as.data.frame(rr[[1]]), as.data.frame(rr[[2]])) > stopifnot(mode(tt)=="character") > > > fitkm.list[[1]] = fitkm.list[[2]] > badpred = SamplePred_parallel(fitkm.list, method="exact", Znew = dat$Z[1,], Xnew = dat$X[1,]) Chain 1 Chain 2 > ff = tapply(badpred$znew1, badpred$chain, mean) > tt = all.equal(ff[1], ff[2]) > stopifnot(mode(tt)=="character") > > proc.time() user system elapsed 5.43 0.45 5.87