(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
 Dieter Senior Member Posts: 2,397 Joined: Dec 2013
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
 « Next Oldest | Next Newest »

 Messages In This Thread (12C) Two Random Generator Comparison - Gamo - 07-25-2018, 10:47 AM RE: (12C) Two Random Generator Comparison - Joe Horn - 07-25-2018, 12:15 PM RE: (12C) Two Random Generator Comparison - Gamo - 07-26-2018, 12:07 AM RE: (12C) Two Random Generator Comparison - Gamo - 07-26-2018, 10:48 AM RE: (12C) Two Random Generator Comparison - Dieter - 07-26-2018, 06:03 PM RE: (12C) Two Random Generator Comparison - Thomas Klemm - 07-27-2018, 07:27 AM RE: (12C) Two Random Generator Comparison - Dieter - 07-27-2018 11:42 AM

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