Test and summary stats, SSY model without discretization


In [1]:
import pandas as pd

In [2]:
%run src/ssy_monte_carlo_test.py

In [3]:
s = SSY()

In [4]:
ssy_compute_stat = ssy_function_factory(s, parallelization_flag=True)

In [29]:
ssy_compute_stat()


Out[29]:
0.9993526539138271

In [31]:
ssy_compute_stat()


Out[31]:
0.9994616175770503

In [32]:
num_reps = 1000

Varying n


In [36]:
vals = np.empty(num_reps)
for i in range(num_reps):
    vals[i] = ssy_compute_stat(n=500, m=5000)

v = pd.Series(vals)

v.describe()


Out[36]:
count    1000.000000
mean        0.999408
std         0.000111
min         0.998564
25%         0.999385
50%         0.999441
75%         0.999473
max         0.999529
dtype: float64

In [37]:
vals = np.empty(num_reps)
for i in range(num_reps):
    vals[i] = ssy_compute_stat(n=1000, m=5000)

v = pd.Series(vals)

v.describe()


Out[37]:
count    1000.000000
mean        0.999384
std         0.000093
min         0.998551
25%         0.999351
50%         0.999409
75%         0.999446
max         0.999517
dtype: float64

In [38]:
vals = np.empty(num_reps)
for i in range(num_reps):
    vals[i] = ssy_compute_stat(n=1500, m=5000)

v = pd.Series(vals)

v.describe()


Out[38]:
count    1000.000000
mean        0.999401
std         0.000061
min         0.999024
25%         0.999386
50%         0.999421
75%         0.999441
max         0.999466
dtype: float64

In [ ]:
vals = np.empty(num_reps)
for i in range(num_reps):
    vals[i] = ssy_compute_stat(n=2000, m=10000)

v = pd.Series(vals)

v.describe()

In [13]:
vals = np.empty(num_reps)
for i in range(num_reps):
    vals[i] = ssy_compute_stat(n=2500, m=1000)

v = pd.Series(vals)

v.describe()


Out[13]:
count    1000.000000
mean        0.999534
std         0.000047
min         0.999272
25%         0.999514
50%         0.999544
75%         0.999568
max         0.999611
dtype: float64

In [14]:
vals = np.empty(num_reps)
for i in range(num_reps):
    vals[i] = ssy_compute_stat(n=3000, m=1000)

v = pd.Series(vals)

v.describe()


Out[14]:
count    1000.000000
mean        0.999549
std         0.000042
min         0.999312
25%         0.999528
50%         0.999559
75%         0.999579
max         0.999621
dtype: float64

In [ ]:

Varying m


In [20]:
vals = np.empty(num_reps)
for i in range(num_reps):
    vals[i] = ssy_compute_stat(n=1000, m=500)

v = pd.Series(vals)

v.describe()


Out[20]:
count    1000.000000
mean        0.999488
std         0.000082
min         0.998834
25%         0.999456
50%         0.999508
75%         0.999544
max         0.999618
dtype: float64

In [21]:
vals = np.empty(num_reps)
for i in range(num_reps):
    vals[i] = ssy_compute_stat(n=1000, m=1000)

v = pd.Series(vals)

v.describe()


Out[21]:
count    1000.000000
mean        0.999470
std         0.000079
min         0.998742
25%         0.999441
50%         0.999490
75%         0.999522
max         0.999584
dtype: float64

In [22]:
vals = np.empty(num_reps)
for i in range(num_reps):
    vals[i] = ssy_compute_stat(n=1000, m=2000)

v = pd.Series(vals)

v.describe()


Out[22]:
count    1000.000000
mean        0.999449
std         0.000080
min         0.999007
25%         0.999422
50%         0.999469
75%         0.999501
max         0.999566
dtype: float64

Large m, n


In [23]:
vals = np.empty(num_reps)
for i in range(num_reps):
    vals[i] = ssy_compute_stat(n=2000, m=2000)

v = pd.Series(vals)

v.describe()


Out[23]:
count    1000.000000
mean        0.999500
std         0.000052
min         0.999084
25%         0.999476
50%         0.999512
75%         0.999536
max         0.999580
dtype: float64

In [24]:
vals = np.empty(num_reps)
for i in range(num_reps):
    vals[i] = ssy_compute_stat(n=1500, m=2000)

v = pd.Series(vals)

v.describe()


Out[24]:
count    1000.000000
mean        0.999476
std         0.000065
min         0.998894
25%         0.999449
50%         0.999490
75%         0.999520
max         0.999567
dtype: float64

In [ ]: