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 CenterFile Exchange에서 Mathematics에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by