Created
April 2, 2021 06:47
-
-
Save peune/eca24f2294bf9bf0697b59f02fd71733 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xmax = 2 | |
d = 1000 | |
X = [i*xmax/d for i in range(d)] | |
alp = np.linspace(0, 5, 2000) | |
for t_eta in [2, 5, 10, 50, 100]: | |
Z = [] | |
for alpha in alp: | |
lambda_m = (1 - math.sqrt(alpha)) **2 | |
lambda_p = (1 + math.sqrt(alpha)) **2 | |
err = 1./snr | |
for x in X: | |
if x == 0: | |
e = (1+inr) | |
else: | |
e = (1+inr)*math.exp(-2*x*t_eta) + (1./(x*snr)) * (1 - math.exp(-2*x*t_eta))**2 | |
p = proba_mp(alpha, x, lambda_m, lambda_p) * e | |
err = err + p | |
err = err * var_eps | |
Z.append(err) | |
plt.plot(alp, Z, label='t_eta = %d' % t_eta) | |
plt.legend(loc="upper right") | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment