Description Usage Arguments Value Details Examples
Monte Carlo simulation of multinomial process
1 |
experiments |
List of multinomial trials. Each
trial is codified as a vector with the number of results in each category.
The number and order of categories must be the same
in every experiment.
In a
binomial experiment, this would be |
n |
Number of simulations to run |
algo |
Algorithm for generating the pseudorandom matrix. The two
most relevant algorithms are |
NRUNIF |
number of decimal places in the pseudo-random numbers. Only for debugging purposes. |
List of results, as described in bernDist
Algorithms 1-4
assume that the probability of each outcome is the same
in every experiment, and therefore the alternative hypothesis
is that at least one of the probabilities is different (either higer or
lower) in at least one experiment. Algorithm 5
only works on 2x2
tables and assumes that the probability of success in the first experiment
is higher than in the second experiment. Each algorithm divides the interval
[0, 1]
in as many sub-intervals as outcomes (nc
), with the first
sub-interval [0, p_1]
and the last (p_nc-1, 1]
:
Generate nc - 1
pseudo-random numbers and divide by their sum. The
resulting values are biased towards 0.5
.
Generate a pseudo-random number p1
between 0 and 1. Then recursively
generate numbers between 1-sum(p1, p2, ...)
until nc - 1
numbers have
been provided. Assign every sub-interval to a pseudo-randomly chosen
outcome. The resulting values are biased towards 0
if nc > 2
.
Like 2
, but the sub-interval that is sub-divided is always the largest
remaining. Less biased than 2
if nc > 2
.
Generate nc - 1
pseudo-random numbers in [0, 1]
, sort them and
use them to divide the interval. This is the default algorithm.
Same as 4
, but one-sided and only for 2x2
tables. The sub-intervals
are generated twice, and the result with a lower probability of success is
assigned to the second experiment.
Same as 5
, but results are not sorted.
1 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.