# How to apply linear least squares fit for two entities?

1 ビュー (過去 30 日間)
Amjad Iqbal 2022 年 7 月 24 日
コメント済み: Matt J 2022 年 7 月 25 日
Dear Researchers,
I have two entities namely sigma (dB) and U (m/s) respectively. As given in attach figure, a linear least squares is used to fit among two entities. I have attached .mat files which contains sigma and U values. I need to fit this curve to analyse Bias and RMS.
Thank you!
##### 2 件のコメント表示 1 件の古いコメント非表示 1 件の古いコメント
Amjad Iqbal 2022 年 7 月 24 日
As a matter of fact, I have sigma_VH from product and using equation-1 given in reference to obtain U.
In Fig-1 (d), this fit is applied among Sigma_VH and U. According to what they claim is nonlinear. However, I tired is linear. As you can see in attached result.
What's your suggetions and how to fit line among these two?

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

### 採用された回答

Matt J 2022 年 7 月 24 日
You can do a total least squares fit using linear2dFit() from,
##### 2 件のコメント表示 1 件の古いコメント非表示 1 件の古いコメント
Matt J 2022 年 7 月 25 日
Works fine for me
>> fobj=linear2dFit([U_vh1(:)';sigma_o_VH1(:).'])
fobj =
linear2dFit with properties:
p1: [4.7831 -27.4053]
p2: [9.1807 -19.8232]

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

### カテゴリ

Find more on Get Started with Curve Fitting Toolbox in Help Center and File Exchange

R2021a

### Community Treasure Hunt

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

Start Hunting!

Translated by