Describe the mistake
The jupyter notebook for Linear Regression has 2 mistakes in the 1. Maximum Likelihood heading . Essentially you are calculating theta_aug_ml with the old y (instead of ynew) and when you are plotting you also using y (instead of ynew). As such the mistake can not be easily observed in the plot, but you are essentially performing the augmented ML estimate on the original dataset and not on the one where y is biased by 2.0
Location
theta_aug_ml = max_lik_estimate_aug(X_aug, y)
2.plt.plot(X, y, '+', markersize=10) below 1. (or the 3rd occurence of this line in the notebook)
Proposed solution
should become theta_aug_ml = max_lik_estimate_aug(X_aug, ynew)
should become plt.plot(X, ynew, '+', markersize=10)
Describe the mistake The jupyter notebook for Linear Regression has 2 mistakes in the 1. Maximum Likelihood heading . Essentially you are calculating theta_aug_ml with the old y (instead of ynew) and when you are plotting you also using y (instead of ynew). As such the mistake can not be easily observed in the plot, but you are essentially performing the augmented ML estimate on the original dataset and not on the one where y is biased by 2.0
Location
theta_aug_ml = max_lik_estimate_aug(X_aug, y)
2.plt.plot(X, y, '+', markersize=10)
below 1. (or the 3rd occurence of this line in the notebook)Proposed solution
theta_aug_ml = max_lik_estimate_aug(X_aug, ynew)
plt.plot(X, ynew, '+', markersize=10)
Additional context N/A