Linear-log regression model (curve fitting)

1 回表示 (過去 30 日間)
Ahmad Hani
Ahmad Hani 2020 年 6 月 16 日
コメント済み: Ameer Hamza 2020 年 6 月 17 日
Dear all
I reask this question with more details
I have this data
x= [50;81;73;77;127;140;122;125;140;145;180;185;178;96;83;192;182;120;127];
y= [122;126;121;123;135;130;117;119;125;125;135;135;140;140;147;147;144;141;139];
y(x) = α + β10 log10(x) + ξ, : ξ ~ N(0, σ^2), random variable that accounts for shadowing variation modeled with normal distribution and standard deviation (Specifically, is a random variable that accounts for shadowing variation modeled with normal distribution and standard deviation σ, assumed equal to the standard deviation of the regression residuals).
How can I use curve fitting to find the values of α, β and ξ,
Expected Output fitting plot

採用された回答

Ameer Hamza
Ameer Hamza 2020 年 6 月 17 日
Try this
x = [50;81;73;77;127;140;122;125;140;145;180;185;178;96;83;192;182;120;127];
y = [122;126;121;123;135;130;117;119;125;125;135;135;140;140;147;147;144;141;139];
[x, idx] = sort(x);
y = y(idx);
log_x = 10*log10(x);
X = [ones(size(x)) log_x];
param = X\y;
y_est = X*param;
y_err = y - y_est;
sigma = std(y_err);
plot(x, y, 'r+', x, y_est, 'b-')
  2 件のコメント
Ahmad Hani
Ahmad Hani 2020 年 6 月 17 日
Thanks Ameer Hamza,
Ameer Hamza
Ameer Hamza 2020 年 6 月 17 日
I am glad to be of help!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLinear and Nonlinear Regression についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by