Multivariate Linear Regression code
Mostra commenti meno recenti
In my hand, 30 samples of 4 features and 30 outputs. i want to learn the regression equation of these as;
theta=theta(0) + theta(1) x(1)+ ... + theta(4) x(4)
I am using gradient descent algorithm for this regression analysis. there are three main equations;
for m=1:30;
cost function= J(theta(0)..,theta(4))=1/2m * sum(h(theta)x - y) ^2
%sum is from 1 to m. x and y are from 1 to m.
theta(j) := theta(j) - alpha (derivative/derivative theta(j)) J(theta(j)
Thanks
1 Commento
b
il 18 Mag 2012
Risposte (2)
Categorie
Scopri di più su Linear Regression in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!