HOW CA I WRITE A OLS CODE FOR THIS FUNCTION?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Using the OLS regression I want to minimize the sum of square residual? How can I do it in matlab P=CD*+error Such as P is a Kx1 matrix and C kxn matrix and D*is a kx1 matrix and the error is a Kx1 matrix And D*=exp(-r(tn)*tn) and I want to get the r(tn) which should be a Kx1 matrix ,t =1,2,….n D=arg {min}_(D*) {ε'ε|ε=P-CD*} And D=((C' C))^(-1) C' P COULD SOME BODY SUGGEST A SOLUTION?PLEASE
0 Kommentare
Antworten (1)
Sargondjani
am 11 Mai 2012
there are many tools. have a look at them (for some you need specific toolboxes):
\ (left divide) regress
curvefit
lsqlin (linear least squares) lsqnonlin (non linear least squares)
for more specific problems: fminunc (unconstrained optimization) fmincon (constrained optimization)
0 Kommentare
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!