I generate three 2D normally distributed distributions with 1000 points each with different means and variances and made sure there is some overlap between the three distributions by visualising the distributions.
dist1= 10 + 5 * np.random.randn(1000,1)
dist2= 15 + 20 * np.random.randn(1000,1)
dist3= 20 + 5 * np.random.randn(1000,1)
Also, the exercise is asking to make sure that the means can be seen to form an approximate equilateral triangle, so I have done this
plt.hist(dist1, bins="auto", stacked =True, alpha=0.3)
plt.axvline(dist1.mean(), color='k', linestyle='dashed', linewidth=1)
plt.hist(dist2, bins="auto", stacked =True, alpha=0.3)
plt.axvline(dist2.mean(), color='k', linestyle='dashed', linewidth=1)
plt.hist(dist3, bins="auto", stacked =True, alpha=0.3)
plt.axvline(dist3.mean(), color='k', linestyle='dashed', linewidth=1)
plt.show()
Would this be the right approach? I am not sure how to create 3 lines so that it shows a triangle
I have also tried this:
D1 = np.random.normal(1.1,5, 1000)
D2 = np.random.normal(1.05,4, 1000)
D3 = np.random.normal(1,3, 1000)
x=np.average(D1)
y=np.average(D2)
z=np.average(D3)
print('')
plt.scatter(x,y)
plt.scatter(y,z)
plt.scatter(z,x)
plt.plot((x,y),(y,z),'-r')
plt.plot((y,z),(z,x),'-p')
plt.plot((z,x),(x,y),'y')
print('')
So I could see the triangle, but not sure.
