Description Usage Arguments Details Value Examples
View source: R/randomSlippage.R
This function inserts a specified number of extra random uniforms into a sequence of calls to a generator, and checks whether the subsequent samples re-synchronize.
1 | randomSlippage(nRuns, expr1, expr2, slip = runif(1), check = FALSE)
|
nRuns |
Number of runs for the comparison. |
expr1, expr2 |
The literal expressions to be evaluated before and after the possible slippage. |
slip |
The expression to be evaluated to cause the slippage; default |
check |
If |
The second generated result from evaluatging expr2
will resynchronize, if ever, after some number of values generated in the original and perturbed sequence, say k1
and k2
. At this point, each sequence returns exactly the same value because each has used the same number of uniforms; from that point on the sequences will be identical.
Re-synchronization need never occur; see the example in the reference.
The function returns a matrix with nRuns
rows and two columns. For each row, the returned value is the slippages, c(k1, k2)
in the Details.
1 2 3 4 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.