GR_CAL_LM — Function to calibrate GR models with a split sample test using lsqrsolve
[X,CR,[CRlog,CRrac,CALC,S,R,IGF]]=GR_CAL_LM(Q,P,E,TS,GRname,[ICAL,TSini,DEBFIN,FOBJ,XFIX,ICONT,XINI])
Discharge data (millimeters, matrix [Nx1] where N is the number of time steps)
Rainfall data (millimeters, matrix [Nx1])
Potential evapotranspiration data (millimeters, matrix [Nx1])
Time step length in hours (default = 24)
Name of the GR model to use (possible = GR4J, GR2M)
Indices of the value to be used within the Q vector during the calibration process. Default = find(Q>=0) (for example, if ICAL=[1,2] only the 2 first time steps are used for calibration)
Number of time-steps required for model initialisation (default = 365*24/TS)
Delimitation of the 2 sub-periods in the dataset (periods including the intialisation of length TSini). DEBFIN should be filled in the following way: [[Beg. of P1 ; End of P1], [Beg. of P2; End of P2]]
Transformation applied to calculate the objective function (default = 'Q', possible = 'logQ' - logarithm transform - or 'racQ' -square root transform -)
Values of fixed parameters, i.e. parameters set to constant values during the calibration process (matrix [5x2]). To calibrate some paramaters and fix others, use the %nan value in XFIX (Ex. [300;%nan;100;1.5;0] allows only the second parameter to be calibrated).
Indices of the value to be used within the Q vector during the control process. Default = ICAL
List of parameters to be tested in the prefiltering operation (list object of 5 vectors, each vector contain the different values to be tested for each parameter (ex: list([200,300],[-1,0],[50,100],[1,2],[0]) )
Optimised parameters for the 2 subperiods (matrix [5x2])
Numerical quality criteria on each sub-period in calibration mode and on a cross-validation mode (matrix [5x4], see CRIT)
Numerical quality criteria on each sub-period in calibration mode and on a cross-validation mode (matrix [5x4], see CRIT)
Numerical quality criteria on each sub-period in calibration mode and on a cross-validation mode (matrix [5x4], see CRIT)
Calculated streamflow time-series (millimeters, matrix [Nx2], first column = calibrated data on P1 and P2, second colmun = validation data).
Time-series of soil-moisture reservoir levels (millimeters, matrix [Nx2])
Time-series of routing store levels (millimeters, matrix [Nx2])
Time-series of intercatchment groundwater flow (millimeters, matrix [Nx2])
The function calibrates the GR4J model developped in Cemagref Antony by Michel, Edijatno(1989) ,Andreassian and Perrin(2003):
(1) The dataset is split into 2 parts defined by the parameter DEBFIN, P1 and P2.
(2) On each sub-period, GR4J is calibrated with the lsqrsolve function (see lsqrsolve function and c_GR4J). The starting point of the optimisation is determined by a selection of the best parameter vector among 9 possibilities (pre-filtering operation)
(3) The calibration quality on P1 and P2 is assessed by calculating quality criteria (see CRIT function).
(4) The model quality in validation mode is assessed by calculating quality criteria on a simulation made on P1 with parameters from P2 and vice-versa.
// Generation of fictious discharge data with the GR4J model (see GR4J help) P = max(0,exp(convol(1/3*ones(1,3),rand(4998,1)+0.2).^5)*10-12)'; // Rainfall T = [0.687;0.498;2.774;6.086;10.565;13.702;16.159;15.585;12.619;8.486;3.300;0.778]; ETP = c_ETP(5000,24,%pi/4,T,198001010000,1); // Potentiel Evapotranspiration xx =[665;1.18;90;3.8;0]; // GR4J parameters e=convol(3/50*ones(1,50),rand(size(P,1),1));e=e(50:$)'-1; Q=c_GR4J(24,xx,P,ETP,[0.6;0.7])+e; // GR4J simulation + autocorrelated random error // GR4J optimisation [X,CR,CRlog,CRrac,CALC,S,R] = GR_CAL_LM(Q,P,ETP,24,'GR4J'); // Plot of results in validation mode CALC(find(CALC<0))=%nan; plot([Q CALC(:,2)]); xtitle('','Days','Discharge (mm/day)');legend(['Obs.' 'Calc.'],%f);
Klemes, V. (1986). "Operational testing of hydrological simulation models." Hydrological Sciences Journal/Journal des Sciences Hydrologiques 31(1): 13-24.
Perrin, C., C. Michel, et al. (2003). "Improvement of a parsimonious model for streamflow simulation." Journal of Hydrology 279(1-4): 275-289.
Edijatno and C. Michel (1989). "Un modèle pluie-débit journalier à trois paramètres." La Houille Blanche 2: 113121.