|
|
@ -10,12 +10,7 @@ theta = zeros(size(X, 2), 1);
|
|
|
|
% to linear regression and put the result in theta.
|
|
|
|
% to linear regression and put the result in theta.
|
|
|
|
%
|
|
|
|
%
|
|
|
|
|
|
|
|
|
|
|
|
% ---------------------- Sample Solution ----------------------
|
|
|
|
theta = pinv(X' * X) * X' * y;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
% -------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
% ============================================================
|
|
|
|
% ============================================================
|
|
|
|