More work on multivariate gaussians.

Not copy edited yet, but more work on making the material on
multivariate gaussian more understandable (mostly by reordering
concepts).
This commit is contained in:
Roger Labbe
2015-11-25 12:39:15 -08:00
parent a57fdfeaa9
commit 7cd8e11b57
4 changed files with 379 additions and 585 deletions

View File

@@ -404,12 +404,16 @@ def plot_3_covariances():
P = [[2, 0], [0, 2]]
plt.subplot(131)
plt.gca().grid(b=False)
plt.gca().set_xticks([0,1,2,3,4])
plot_covariance_ellipse((2, 7), cov=P, facecolor='g', alpha=0.2,
title='|2 0|\n|0 2|', axis_equal=False)
plt.ylim((4, 10))
plt.gca().set_aspect('equal', adjustable='box')
plt.subplot(132)
plt.gca().grid(b=False)
plt.gca().set_xticks([0,1,2,3,4])
P = [[2, 0], [0, 9]]
plt.ylim((4, 10))
plt.gca().set_aspect('equal', adjustable='box')
@@ -417,6 +421,8 @@ def plot_3_covariances():
axis_equal=False, title='|2 0|\n|0 9|')
plt.subplot(133)
plt.gca().grid(b=False)
plt.gca().set_xticks([0,1,2,3,4])
P = [[2, 1.2], [1.2, 2]]
plt.ylim((4, 10))
plt.gca().set_aspect('equal', adjustable='box')
@@ -437,7 +443,7 @@ def plot_correlation_covariance():
plt.gca().autoscale(tight=True)
plt.axvline(7.5, ls='--', lw=1)
plt.axhline(12.5, ls='--', lw=1)
plt.scatter(7.5, 12.5, s=2000, alpha=0.5)
plt.scatter(7.5, 12.5, s=1500, alpha=0.5)
plt.title('|4.0 3.9|\n|3.9 4.0|')
plt.show()