Skip to content

Instantly share code, notes, and snippets.

@podopie
Last active September 27, 2015 17:48
Show Gist options
  • Save podopie/1308147 to your computer and use it in GitHub Desktop.
Save podopie/1308147 to your computer and use it in GitHub Desktop.
sum0=0;
sum1=0;
for i=1:m,
sum0=sum0+(theta(1)+theta(2)*X(i,2))-y(i);
sum1=sum0*X(i,2);
end
temp0=theta(1)-(alpha/m)*sum0;
temp1=theta(2)-(alpha/m)*sum1;
theta(1)=temp0;
theta(2)=temp1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment