In [1]:
import matplotlib.pyplot as plt
In [2]:
%run src/ssy_mc_truncation_test.py
In [3]:
ssy = SSY()
In [4]:
f = ssy_function_factory(ssy)
In [5]:
seed = 12345
f(seed=seed)
Out[5]:
In [6]:
G = 20
trunc_vals = np.linspace(0.5, 5.0, G)
In [7]:
out = []
for t in trunc_vals:
out.append(f(trunc_val=t, seed=seed))
In [8]:
out
Out[8]:
In [9]:
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.99925, 0.99985))
ax.set_ylabel("$\Lambda$")
ax.set_xlabel("Truncation value")
ax.legend()
plt.tight_layout()
plt.savefig("temp.pdf")