Test and summary stats, BY model


In [1]:
import matplotlib.pyplot as plt
import pandas as pd

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

In [3]:
b = BY()

In [4]:
by_compute_stat = by_function_factory(b, parallelization_flag=True)

In [5]:
by_compute_stat()


Out[5]:
0.9980300945320473

In [6]:
by_compute_stat()


Out[6]:
0.9980347108148537

In [15]:
num_reps = 1000

Varying n


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

v = pd.Series(vals)

v.describe()


Out[16]:
count    1000.000000
mean        0.998086
std         0.000059
min         0.997823
25%         0.998059
50%         0.998097
75%         0.998128
max         0.998209
dtype: float64

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

v = pd.Series(vals)

v.describe()


Out[17]:
count    1000.000000
mean        0.998128
std         0.000053
min         0.997823
25%         0.998099
50%         0.998136
75%         0.998166
max         0.998240
dtype: float64

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

v = pd.Series(vals)

v.describe()


Out[18]:
count    1000.000000
mean        0.998159
std         0.000047
min         0.997919
25%         0.998134
50%         0.998167
75%         0.998192
max         0.998246
dtype: float64

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

v = pd.Series(vals)

v.describe()


Out[19]:
count    1000.000000
mean        0.998149
std         0.000021
min         0.997985
25%         0.998149
50%         0.998157
75%         0.998159
max         0.998160
dtype: float64

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

v = pd.Series(vals)

v.describe()


Out[20]:
count    1000.000000
mean        0.998208
std         0.000042
min         0.997935
25%         0.998188
50%         0.998214
75%         0.998238
max         0.998288
dtype: float64

In [ ]:

Varying m


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

v = pd.Series(vals)

v.describe()


Out[21]:
count    1000.000000
mean        0.998141
std         0.000058
min         0.997870
25%         0.998112
50%         0.998150
75%         0.998181
max         0.998258
dtype: float64

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

v = pd.Series(vals)

v.describe()


Out[22]:
count    1000.000000
mean        0.998124
std         0.000054
min         0.997788
25%         0.998096
50%         0.998132
75%         0.998162
max         0.998241
dtype: float64

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

v = pd.Series(vals)

v.describe()


Out[23]:
count    1000.000000
mean        0.998045
std         0.000023
min         0.997799
25%         0.998044
50%         0.998053
75%         0.998057
max         0.998060
dtype: float64

Large m, n


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

v = pd.Series(vals)

v.describe()


Out[24]:
count    1000.000000
mean        0.998150
std         0.000026
min         0.997967
25%         0.998148
50%         0.998160
75%         0.998165
max         0.998167
dtype: float64

In [ ]: