From bff8a4bd250105e4c6dd681a62d2510d187df123 Mon Sep 17 00:00:00 2001 From: Daniel Turek Date: Mon, 5 Feb 2024 09:33:59 -0500 Subject: [PATCH] added print to tests --- nimbleHMC/tests/testthat/test-HMC.R | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nimbleHMC/tests/testthat/test-HMC.R b/nimbleHMC/tests/testthat/test-HMC.R index 7395eda..453ac14 100644 --- a/nimbleHMC/tests/testthat/test-HMC.R +++ b/nimbleHMC/tests/testthat/test-HMC.R @@ -31,7 +31,9 @@ test_that('HMC sampler seems to work', { set.seed(0) samples <- runMCMC(Cmcmc, 100000) ## + print(abs(as.numeric(apply(samples, 2, mean)) - c(0.4288181, 1.8582433, 3.2853841))) expect_true(all(abs(as.numeric(apply(samples, 2, mean)) - c(0.4288181, 1.8582433, 3.2853841)) < 0.0105)) + print(abs(as.numeric(apply(samples, 2, sd)) - c(0.9248042, 1.1964343, 1.3098622))) expect_true(all(abs(as.numeric(apply(samples, 2, sd)) - c(0.9248042, 1.1964343, 1.3098622)) < 0.011)) } })