Question About Correction Factor

4 次查看(过去 30 天)
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
Thank you much for your response and suggestion. I really appreciate it.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 MATLAB 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by