Two more for the road: the PIE ROM and the RANDOM ROM
04-29-2022, 11:49 PM
Post: #5
 Albert Chan Senior Member Posts: 2,109 Joined: Jul 2018
RE: Two more for the road: the PIE ROM and the RANDOM ROM
(04-29-2022 09:26 AM)Ángel Martin Wrote:  The curious angle to this is that the "modified" TOULMTAH RNG yields better results when used in the Gaussian RNG methods, i.e. the results had a better "normality". On the other hand, the "randomness" of the modified and original TOULMATH were very similar

100 points sample size might be too small to deduce which GRN is better.
Also, "normality index" from 6 quantiles points might be too little.

Instead of checking "normality", we could apply "cdf", turn them back to uniform randoms.
Checking for uniform random distribution is much easier.
Scatterplots may be enough to call the "winner".

This got me thinking ...

Why not use 1 uniform random, apply inverse cdf, to get 1 GRN ?
icdf(p) = ierfc(p*2)*-sqrt(2), and ierfc can be cheaply calculated.

lua> T = setmetatable({}, {__index = function(F, i) return 0 end})
lua> for i=1,1e6 do x=round(icdf(random())*4)/4; T[x]=T[x]+1 end

lua> T[0] / 1e6 -- slot for z within +/- 1/8
0.09953
lua> cdf(1/8)*2 - 1 --> distribution matched standard normal
0.09947644966022584

lua> for z=-4,4,1/4 do print(z,('*'):rep(T[z]/1400)) end
-4
-3.75
-3.5
-3.25
-3    *
-2.75 **
-2.5  ***
-2.25 ******
-2    **********
-1.75 ****************
-1.5  ***********************
-1.25 ********************************
-1    ********************************************
-0.75 ******************************************************
-0.5  ***************************************************************
-0.25 *********************************************************************
0     ***********************************************************************
0.25  *********************************************************************
0.5   ***************************************************************
0.75  *****************************************************
1     *******************************************
1.25  ********************************
1.5   ***********************
1.75  ****************
2     **********
2.25  ******
2.5   ***
2.75  **
3     *
3.25
3.5
3.75
4
 « Next Oldest | Next Newest »

 Messages In This Thread Two more for the road: the PIE ROM and the RANDOM ROM - Ángel Martin - 04-20-2022, 12:32 PM RE: Two more for the road: the PIE ROM and the RANDOM ROM - J-F Garnier - 04-28-2022, 08:03 AM RE: Two more for the road: the PIE ROM and the RANDOM ROM - Ángel Martin - 04-28-2022, 01:54 PM RE: Two more for the road: the PIE ROM and the RANDOM ROM - Ángel Martin - 04-29-2022, 09:26 AM RE: Two more for the road: the PIE ROM and the RANDOM ROM - Albert Chan - 04-29-2022 11:49 PM

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