Question About Correction Factor

4 ビュー (過去 30 日間)
Ignatius Tommy Pratama
Ignatius Tommy Pratama 2017 年 12 月 17 日
コメント済み: Star Strider 2017 年 12 月 18 日
Hi.. Currently, I am doing a model bias analysis. I found a code that is written as follows:
FS = fs_1d(He,Hp,dHw,gamma_sat,model_factor);
M = 1./FS; m = mean(log(M)); s = std(log(M));
A = [ones(11,1) dHw'./He']; para = (A'*A)\A'*log(M');
FS_new = exp(para(1)+para(2)*dHw./He).*fs_1d(He,Hp,dHw,gamma_sat,model_factor);
M_new = 1./FS_new; m_new = mean(log(M_new)); s_new = std(log(M_new));
I am curious about "para" equation in the above code. I believe that equation has a function to correct the FS code. If someone knows about the clear functions or benefits of that equation and the meaning behind the para equation, I would be very glad to hear your opinion. I really look forward to your reply and suggestion. Thank you.
  1 件のコメント
Jan
Jan 2017 年 12 月 17 日
Well, you should find the explanations of the applied calculations in the documentation of the code. Search either in the header or in the comments on top of the block of code. If there are no comments consider the code as useless. Sorry for this pessimistic view, but I have seen too many code, which have been written with great ideas, but without the wisdom to mention the ideas in the comments. This is a pity.

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

回答 (1 件)

Star Strider
Star Strider 2017 年 12 月 17 日
It seems that ‘para’ is a very inefficient least-square parameter estimation assignment (likely explaining the variable name ‘para’). An equivalent (and much more efficient) calculation would simply be:
para = A \ log(M');
It then uses those coefficients to inefficiently plot a fit to the data. A more efficient calculation would be:
exp(A * para)
that is part of the ‘FS_new’ calculation.
It is better to do a nonlinear parameter estimation to directly estimate the ‘para’ parameters, rather than doing to logarithmic mapping. This can easily be done with fminsearch and a couple earlier lines of code.
  2 件のコメント
Ignatius Tommy Pratama
Ignatius Tommy Pratama 2017 年 12 月 18 日
Thank you much for your response and suggestion. I really appreciate it.
Star Strider
Star Strider 2017 年 12 月 18 日
My pleasure.

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

カテゴリ

Help Center および File ExchangeMathematics についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by