from matplotlib.pyplot import *
from pylab import *
from mpl_toolkits.mplot3d import Axes3D

SIGMA = array([[1, 0.5],[0.5,1]])



X,Y = mgrid[-4:4:.1, -4:4:.1]
mu = X.mean(axis=0)


part1 = ((linalg.det(2*pi*SIGMA))**(-0.5))
print part1

#part2 = (X-mu).conj().transpose()*linalg.inv(SIGMA)*(X-mu)

print part2

part3 = exp(-0.5*part2)
print part3

Z=part1*part3

ax = gca(projection='3d')
ax.plot_surface(X,Y,Z, rstride=1,cstride=1,cmap=cm.jet, linewidth=0,antialiased=False)
show()


@@ -120,16 +120,37 @@
 .5,1%5D%5D)%0A
+MU = array(%5B%5B1%5D,%5B2%5D%5D)
 %0A%0A%0AX,Y =
@@ -161,17 +161,17 @@
 id%5B-
-4
+2
 :4:.1, -
 4:4:
@@ -170,36 +170,37 @@
 1, -
-4
+2
 :4:.1%5D%0A
-mu = X.mean(axis=0)%0A
+%0Ax = array(%5B%5BX%5D,%5BY%5D%5D)
 %0A%0Apa
@@ -244,35 +244,29 @@
 5))%0A
-print part1%0A%0A#part2 = (X-mu
+%0Apart2 = (-0.5)*(x-MU
 ).co
@@ -305,20 +305,15 @@
 A)*(
-X-mu)%0A%0Aprint
+x-MU)%0A%0A
  par
@@ -344,14 +344,8 @@
 t2)%0A
-print 
 part

question 3