Post Reply 
(12C) Two Random Generator Comparison
07-27-2018, 11:42 AM (This post was last modified: 07-27-2018 12:15 PM by Dieter.)
Post: #7
RE: (12C) Two Random Generator Comparison
(07-27-2018 07:27 AM)Thomas Klemm Wrote:  
(07-26-2018 06:03 PM)Dieter Wrote:  Yes, the calculated (sample) standard deviation actually is slightly less by a factor of sqrt((n–1)/n) but for large sample sizes this does not make much of a difference.

Or then you just add the mean before calculating the standard deviation:
  • [\(\bar{x}\)]
  • [\(\Sigma+\)]
  • [\(s\)]

That's a good idea. This also leaves the mean unaffected so that both [\(\bar{x}\)] and [\(s\)] return the desired results, i.e. mean and population standard deviation.

To implement this idea simply replace line 21 (GTO 00) with GTO 37 and add this:

Code:
37 x-bar
38 Σ+
39 CLX
40 GTO 00

This way the example with seed = 0,1234567 returns

g [\(\bar{x}\)] => 0,4855 [X<>Y] 0,5002
g [\(s\)] => 0,2897 [X<>Y] 0,2886

So for this seed (!) the second RNG almost perfectly matches the theoretical values.

Also these results are not very different from the original ones with the sample standard deviation.
Rule of thumb: For 10n random numbers the results agree in n decimals. In this case, with 10³ numbers, in the first three (0,290 and 0,289).

Dieter
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: (12C) Two Random Generator Comparison - Dieter - 07-27-2018 11:42 AM



User(s) browsing this thread: 1 Guest(s)