tests/testthat/test_samplers.R

library(deBInfer)
context("Testing samplers")

test_that("reflecting sampler does not return out-of-bounds values", {
  for(i in rep(c(-5,-1,0,0.5,1,5),100)){
    proposal <- deBInfer:::propose_single_rev(samps=c(b=5), s.p=list(name='b', prop.var=0.7, samp.type="rw-ref", hypers=NULL, bounds=c(0,1)))$b
    expect_true(proposal <= 1 & proposal >= 0)
  }


})

Try the deBInfer package in your browser

Any scripts or data that you put into this service are public.

deBInfer documentation built on Nov. 17, 2022, 5:07 p.m.