Least Squares Optimization Basics

14 ビュー (過去 30 日間)
Nam Tran
Nam Tran 2017 年 3 月 29 日
コメント済み: Alan Weiss 2017 年 3 月 30 日
Hello All,
I'm very new to optimization. I have a problem and not sure the best way to go about it. Lets say from data from the field for a model at a given time, I am able to have one data point. For example,
(t1,y1) (t2,y2) (t3,y3)
Now lets say I have an analytical code that tries to model this behavior such that the output is,
(t1,z1) (t2,z2) (t3,z3)
The analytical code uses 10 parameters that I want to guess such that the error between the "y" and "z" is at a minimum by using a least squares minimum.
I'm looking at fmincon and lsqlin but am confused to say the very least. If there is any good material that anyone can link or tell me the direction to head in, that would be great. Thank you for your time!

採用された回答

Matt J
Matt J 2017 年 3 月 29 日
編集済み: Matt J 2017 年 3 月 29 日
I'd recommend lsqcurvefit,
x= lsqcurvefit(fhandle,x0,[t1,t2,t3],[y1,y2,y3])
where x0 is a vector of your 10 initial parameter guesses. You need to provide the function handle fhandle to the function z=F(x,t) that generates your z-samples.
  1 件のコメント
Alan Weiss
Alan Weiss 2017 年 3 月 30 日
To expand on this recommendation, look at Nonlinear Data-Fitting and maybe at Nonlinear Curve Fitting with lsqcurvefit.
Alan Weiss
MATLAB mathematical toolbox documentation

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLinear Least Squares についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by