model parameter estimation from RMSE between modeled outputs and observations
1 回表示 (過去 30 日間)
古いコメントを表示
Hello,
I am a hydrologist, and trying to estimate soil parameters by using RMSE between modeled outputs (streamflow) and observed ones.
For example, a watershed model is applied from 1980 to 2000 with an initial set of parameters. RMSE can be calcuated between modeled streamflow and observed ones.
With the RMSE values, is there any matlab function to search a new set of parameters to try to reduce RMSE?
The curve for RMSE over an iteration would be ideally converged in a global minimization point.
Thanks!
0 件のコメント
回答 (2 件)
Jeff Miller
2020 年 12 月 23 日
I assume the model is too complex for regression, etc. In that case, you might be able to do this with fminsearch, if there are not too many parameters. You write a function to compute RMSE for any given parameter vector, and fminsearch will try to find the parameter values that will minimize that function.
3 件のコメント
Jeff Miller
2020 年 12 月 24 日
This forum seems to have a number of examples using fminsearch in various ways. Not sure if any of them minimize RMSE specifically, but the general principles are the same regardless of what error function you compute.
Jeff Miller
2020 年 12 月 26 日
Something like this. If it is too slow, note that you can use 'optimset' to pass fminsearch options that make it finish faster (at the loss of a little precision in your parameter estimates).
function rresult = calibgrain(DBn_2,dateob,Tb)
dss = linspace(0.01,3,100);
ggf = linspace(0.5,5,100);
rresult = [];
for ii = 1:length(dss)
for jj = 1:length(ggf)
dsnowi = dss(ii);grfactor = ggf(jj);
startparms = [dsnowi,grfactor];
bestparms = fminsearch(@RMSE1,startparms);
dsnowi = bestparms(1);
grfactor = bestparms(2);
[dsns_2,lws,btotals,phis,dsnows_y2_r1,tsnows,sds_0,kss,tsss,gds,outmelts,YEH,YEV,YEVH, YEHV,result,compaction,ritisi,stor,ro] = msnow(1,6552,DBn_2,dsnowi,grfactor);
rmsecomp = calcrmse(YEH,dateob,Tb);
rresult = [rresult ;dsnowi grfactor rmsecomp];
jj
end
ii
%jj
function thisrmse = RMSE1(parms)
% nest this function inside calibgrain so that it has
% access to all of calibgrain's variables.
dsnowi = parms(1);
grfactor = parms(2);
[dsns_2,lws,btotals,phis,dsnows_y2_r1,tsnows,sds_0,kss,tsss,gds,outmelts,YEH,YEV,YEVH, YEHV,result,compaction,ritisi,stor,ro] = msnow(1,6552,DBn_2,dsnowi,grfactor);
thisrmse = calcrmse(YEH,dateob,Tb);
end
end
5 件のコメント
Jeff Miller
2020 年 12 月 27 日
Sorry, I don't see what is causing that. Is it possible that your original call to calibgrain (outside of all this code) did not pass its required 3 parameters?
参考
カテゴリ
Help Center および File Exchange で Oceanography and Hydrology についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!