Hi,
I already got help by this forum for this problem: Categorical Regression
Luckily, with some help by @martinmodrak and @simonbrauer I got the model running but I’m still working on this. This was the latest version:
Now I was doing some prior predictive analysis and I’m not happy with the priors I’ve choosen:
This is the code to run the prior predictive simulation:
a = np.random.normal(loc=0, scale=1, size=12000)
b = np.random.normal(loc=0, scale=5, size=12000)
a = a.reshape([3,4000])
b = b.reshape([3,4000])
s1 = a[0,:]+ b[0,: ]
s2 = a[1,:]+ b[1,: ]
s3 = a[2,:]+ b[2,: ]
s4= 0
simulations = np.empty(shape=(len(s1),4))
for i in range(len(s1)):
s = (s1[i],s2[i],s3[i],s4);
u = special.softmax(s);
simulations[i,:] = u
%matplotlib notebook
plt.figure()
ax = plt.subplot(111)
plt.violinplot(
simulations,
showmeans=False,
showmedians=True
)
ax.set_title("Prior Predictive Plot")
ax.set_ylabel("Probability")
ax.set_xticklabels(["","Pos.","","Neg.","","Hydr.","","Oth."])
ax.set_ylim(-0.1,1.1)
I look for a mean and standard deviation so that my priors approach more a uniform distribution, but I’m not able to find any. The best I found so far is:
a = np.random.normal(loc=0, scale=1, size=12000)
b = np.random.normal(loc=0, scale=1.5, size=12000)
That gave me this:
Any ideas, how I can get a more uniform distribution?
Best,
Thorsten