Question About Correction Factor

4 vues (au cours des 30 derniers jours)
Ignatius Tommy Pratama
Ignatius Tommy Pratama le 17 Déc 2017
Commenté : Star Strider le 18 Déc 2017
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 commentaire
Jan
Jan le 17 Déc 2017
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.

Connectez-vous pour commenter.

Réponses (1)

Star Strider
Star Strider le 17 Déc 2017
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 commentaires
Ignatius Tommy Pratama
Ignatius Tommy Pratama le 18 Déc 2017
Thank you much for your response and suggestion. I really appreciate it.
Star Strider
Star Strider le 18 Déc 2017
My pleasure.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Mathematics dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by