In [1]:
import matplotlib.pyplot as plt
In [6]:
%run src/by_mc_truncation_test.py
In [7]:
by = BY()
In [8]:
f = by_function_factory(by)
In [17]:
seed=1234
f(seed=seed)
Out[17]:
In [18]:
G = 20
trunc_vals = np.linspace(0.5, 5.0, G)
In [19]:
out = []
for t in trunc_vals:
out.append(f(trunc_val=t, seed=seed))
In [20]:
out
Out[20]:
In [23]:
fig, ax = plt.subplots()
ax.plot(trunc_vals, out, label="$\Lambda$ with truncation")
ax.plot(trunc_vals, np.ones(G) * f(seed=seed), "k--", label="$\Lambda$ without explicit truncation")
ax.set_ylim((0.9978, 0.9984))
ax.set_ylabel("$\Lambda$")
ax.set_xlabel("truncation value")
ax.legend()
plt.savefig("temp.pdf")
In [ ]: