Observe:
sr = 666;
d = PascalDistribution[1, 1/50];
od = OrderDistribution[{d, 10}, 1];
Column[{Mean[od] // N,
SeedRandom[sr];
Dimensions@(t1 = RandomVariate[d, {1000, 10}]),
SeedRandom[sr];
Dimensions@(t2 = Table[RandomVariate[d, 10], 1000]),
SeedRandom[sr];
Dimensions@(t3 = Partition[RandomVariate[d, 10000], 10]),
SeedRandom[sr];
Dimensions@(t4 =
ArrayReshape[Table[RandomVariate[d, 100], 100], {1000, 10}]),
Min /@ t1 // Mean // N,
Min /@ t2 // Mean // N,
Min /@ t3 // Mean // N,
Min /@ t4 // Mean // N}]
5.46666
{1000,10}
{1000,10}
{1000,10}
{1000,10}
5.463
6.484
5.463
5.463
The results from Min/@t...//Mean//N
should be the same for all four cases.
Note the result (using the 666 seed) of 6.484 for the t2
case. This is consistently wacky (~+1 from actual expectation shown by the mean of the order distribution).
Changing the inner cardinality for the t4
case to anything 80 or above (e.g. ArrayReshape[Table[RandomVariate[d, 80], 125], {1000, 10}]
keeps it consistent, but lowering it to say 50 in the RV generation results in also off-kilter results.
I'd venture there is some kind of heuristic switching of methods going on based on requested number of samples, and perhaps a bug in the low-count algorithm.
On 10.3 Windows, same results on 9.X Windows.
I'd appreciate verification (and explanation if I've pulled a DOH and there's a reason for this behavior).
NegativeBinomialDistribution
RandomVariate
is implemented in a very similar way (calling the sameStatistics`BinomialDistributionsDump`*
functions), but doesn't produce inconsistent results (at least not for the same parameters used in this question). $\endgroup$