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!