Skip to content
Snippets Groups Projects
Commit 64239876 authored by Mirko Birbaumer's avatar Mirko Birbaumer
Browse files

adapted beta_commands

parent a4b3fc67
No related merge requests found
Pipeline #647850 passed
source diff could not be displayed: it is too large. Options to address this: view the blob.
...@@ -30,7 +30,7 @@ x = np.linspace(0,1,1000) ...@@ -30,7 +30,7 @@ x = np.linspace(0,1,1000)
def prior(a,b,z,N, prob=.95): def prior(a,b,z,N, prob=.95):
plt.subplots(3, 1, sharey=True) plt.subplots(3, 1)
plt.subplot(311) plt.subplot(311)
y = beta.pdf(x,a,b) y = beta.pdf(x,a,b)
omega = np.round((z+a-1)/(z+a+N-z+b-2),3) omega = np.round((z+a-1)/(z+a+N-z+b-2),3)
...@@ -59,8 +59,9 @@ def prior(a,b,z,N, prob=.95): ...@@ -59,8 +59,9 @@ def prior(a,b,z,N, prob=.95):
plt.subplot(312) plt.subplot(312)
y = x**z*(1-x)**(N-z)*1000 y = x**z*(1-x)**(N-z)
plt.ylim(0, np.max(y)*1.1)
plt.plot(x,y,color="seagreen") plt.plot(x,y,color="seagreen")
plt.title("Likelihood (Bernoulli)") plt.title("Likelihood (Bernoulli)")
plt.xlabel(r"$θ$") plt.xlabel(r"$θ$")
...@@ -68,6 +69,7 @@ def prior(a,b,z,N, prob=.95): ...@@ -68,6 +69,7 @@ def prior(a,b,z,N, prob=.95):
plt.fill_between(x,y,facecolor="mediumaquamarine") plt.fill_between(x,y,facecolor="mediumaquamarine")
plt.text(0, np.max(y)*.75, "Daten: $z=\ $"+str(z)+", $N =\ $"+str(N),ha="left") plt.text(0, np.max(y)*.75, "Daten: $z=\ $"+str(z)+", $N =\ $"+str(N),ha="left")
plt.text(0, np.max(y)*.4, "Max bei 0.85",ha="left") plt.text(0, np.max(y)*.4, "Max bei 0.85",ha="left")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment