Borrar filtros
Borrar filtros

HOW CA I WRITE A OLS CODE FOR THIS FUNCTION?

2 visualizaciones (últimos 30 días)
Ashwaq
Ashwaq el 11 de Mayo de 2012
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

Respuestas (1)

Sargondjani
Sargondjani el 11 de Mayo de 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)

Categorías

Más información sobre Linear Least Squares en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by