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. > 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.00221 secs elapsed) Iteration: 3 (30% completed; 0.01192 secs elapsed) Iteration: 4 (40% completed; 0.0134 secs elapsed) Iteration: 5 (50% completed; 0.0148 secs elapsed) Iteration: 6 (60% completed; 0.01626 secs elapsed) Iteration: 7 (70% completed; 0.01774 secs elapsed) Iteration: 8 (80% completed; 0.01921 secs elapsed) Iteration: 9 (90% completed; 0.02065 secs elapsed) Iteration: 10 (100% completed; 0.0221 secs elapsed) Chain 2 Iteration: 2 (20% completed; 0.00137 secs elapsed) Iteration: 3 (30% completed; 0.00292 secs elapsed) Iteration: 4 (40% completed; 0.00441 secs elapsed) Iteration: 5 (50% completed; 0.0059 secs elapsed) Iteration: 6 (60% completed; 0.00735 secs elapsed) Iteration: 7 (70% completed; 0.00882 secs elapsed) Iteration: 8 (80% completed; 0.01029 secs elapsed) Iteration: 9 (90% completed; 0.01175 secs elapsed) Iteration: 10 (100% completed; 0.01321 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.39 0.60 5.98