human
Can you provide a code to 1 given the following:
1.1 Multivariate Gaussian Distribution
1.1.1 Univariate Gaussian Distribution
$p(x.
\mu, \sigma ^2) = \frac{1}{\sqrt{2\pi}\cdot\sigma}exp\Big({-\frac{(x-\mu)^2}{2\sigma^2}}\Big)$, where<br />
$\sigma$ is variance.<br />
1.1.2 Multivariate Gaussian Distribution
$p(x.
\mu, \Sigma) = \frac{1}{{(2\pi)^{n/2}}\cdot{|\Sigma|^{1/2}}}exp\Big(-\frac{1}{2}(x-\mu)\Sigma^{-1}(x-\mu)^T\Big)$, where<br />
$\Sigma$ is a covariance matrix (size $k\times k$);<br />
$|\Sigma|$ is the determinant of a covariance matrix $\Sigma$<br />"
Please write code following the instructions in jupyter notebook style.
assistant
#Here is code to 1.

def gaussianParameter(X):
    return np.mean(X, axis=0), np.cov(X.T)

def gaussianDistribution(X):
    mu, Sigma = np.mean(X, axis=0), np.cov(X.T)
    detSigma = np.linalg.det(Sigma)
    

mu, Sigma = gaussianParameter(anomalyX)
print(anomalyX.shape)
print(mu.shape)
print(Sigma.shape)
# def plotMultGaussian():
plt.plot(anomalyX[:,:1], anomalyX[:,1:], 'o', markersize=3, alpha=.3)
minX = 0,30
maxX = 0,30
XX, YY = np.mgrid[0:30:.5, 0:30:.5]
XY = np.empty(XX.shape + (2,))
XY[:, :, 0] = XX
XY[:, :, 1] = YY
multivariateGaussian = multivariate_normal(mu, Sigma)
plt.contour(XX, YY, multivariateGaussian.pdf(XY), [10 ** a for a in range(-22,0,4)])
plt.axis('equal')
plt.show

σ = np.diag(np.var(anomalyX, axis=0))

plt.plot(anomalyX[:,:1], anomalyX[:,1:], 'o', markersize=3, alpha=.3)
minX = 0,30
maxX = 0,30
XX, YY = np.mgrid[0:30:.5, 0:30:.5]
XY = np.empty(XX.shape + (2,))
XY[:, :, 0] = XX
XY[:, :, 1] = YY
multivariateGaussian_1 = multivariate_normal(mu, σ)
plt.contour(XX, YY, multivariateGaussian_1.pdf(XY), [10**a for a in range(-22,0,4)])
plt.axis('equal')
plt.show