Gaussian Maximum Likelihood#

MLE of a Gaussian \(p_{model}(x|w)\)#

You are given an array of data points called data. Your course site plots the negative log-likelihood function for several candidate hypotheses. Estimate the parameters of the Gaussian \(p_{model}\) by coding an implementation that estimates its optimal parameters (15 points) and explaining what it does (10 points). You are free to use any Gradient-based optimization method you like.

import numpy as np

data = [4, 5, 7, 8, 8, 9, 10, 5, 2, 3, 5, 4, 8, 9]

# add your code here

MLE of a conditional Gaussian \(p_{model}(y|x,w)\)#

You are given a problem that involves the relationship between \(x\) and \(y\). Estimate the parameters of a \(p_{model}\) that fit the dataset (x,y) shown below. You are free to use any Gradient-based optimization method you like.

x = np.array([8, 16, 22, 33, 50, 51])
y = np.array([5, 20, 14, 32, 42, 58])

# add your code here