Description Usage Arguments Value References Examples
View source: R/expect_simctest.R
Test if the success probability of a Bernoulli experiment lies within a desired 'bucket'. This used the sequential procedure described in \insertCiteGandyHahnDing:pvaluebuckets;textualmcunit.
1 | expect_bernoulli(object, J, ok, epsilon = 0.001, ...)
|
object |
Function that performs one sampling step. Returns 0 or 1. |
J |
Buckets to use. A matrix with two rows, each column describes an interval bucket. Column names give names for the bucket(s). |
ok |
Name of bucket(s) that pass the Unit test. |
epsilon |
Error bound. |
... |
Further parameters to be passed on to 'mctest'. |
The first argument, invisibly, to allow chaining of expectations.
1 2 3 4 | J <- matrix(nrow=2,c(0,0.945, 0.94,0.96, 0.955,1))
colnames(J) <- c("low","ok","high")
gen <- function() as.numeric(runif(1)<0.95)
expect_bernoulli(gen,J=J,ok="ok")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.