expect_mc_iid_ks {mcunit} | R Documentation |
Test iid samples for correct cdf using KS test
Description
Test if samples are behaving like an iid sample from a given CDF via the KS test and a sequential approach. Only works for continuous CDFs. Will report a warning if values are discrete
Usage
expect_mc_iid_ks(object, cdf, control = NULL)
Arguments
object |
A function taking one argument - that generates n univariate iid samples. |
cdf |
A univariate cumulative distribution function, taking exactly one argument. |
control |
a list controlling the algorithm
|
Value
The first argument, invisibly, to allow chaining of expectations.
Examples
sampler <- function(n) rnorm(n)
expect_mc_iid_ks(sampler, pnorm)