Skip to content

Commit

Permalink
added print to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
danielturek committed Feb 5, 2024
1 parent 96be9a3 commit bff8a4b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions nimbleHMC/tests/testthat/test-HMC.R
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
})
Expand Down

0 comments on commit bff8a4b

Please sign in to comment.