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

@@ -37,6 +37,24 @@ def plot_height_std(x, lw=10):
plt.show()
def plot_correlated_data(X, Y, xlabel=None,
ylabel=None, equal=True):
plt.scatter(X, Y)
if xlabel is not None:
plt.xlabel('Height (in)');
if ylabel is not None:
plt.ylabel('Weight (lbs)')
# fit line through data
m, b = np.polyfit(X, Y, 1)
plt.plot(X, np.asarray(X)*m + b,color='k')
if equal:
plt.gca().set_aspect('equal')
plt.show()
def plot_gaussian (mu, variance,
mu_line=False,
xlim=None,