Skip to content

Commit

Permalink
added prints to testing
Browse files Browse the repository at this point in the history
  • Loading branch information
danielturek committed Feb 5, 2024
1 parent 80bf7ed commit 7fdbe52
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 @@ -59,7 +59,9 @@ test_that('HMC sampler on subset of nodes', {
Cmcmc <- compileNimble(Rmcmc, project = Rmodel)
set.seed(1)
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.015))
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.01))
}
})
Expand Down

0 comments on commit 7fdbe52

Please sign in to comment.