# Analysis of the computed results owing the different scenarios
Idea of analysis workflow :
1. Goodness of fit assessment : would use 3 different indicators (graphical, dimensional and dimensionless), their consistency and statistical relevance would be assessed
* Graphical tool : scatter plot of observed values against modeled : assess the goodness of match of the (1:1) line
* The statistical relevance of each index will be check using a non parametric test. The probability distribution will be obtained by block bootstrapping. The choice of the block bootstrapping method still need to be done. One possible way is the stationnary bootstrapping method (*Politis and Romano, 1994*), (*Patton et al. 2009*)
## **Importing the relevant librairies**
%% Cell type:code id:banner-huntington tags:
%% Cell type:code id:hydraulic-particular tags:
``` python
# Importing of software packages and setting notebook options
The performance of the model seems to be related to the season. To go further : explore the relation between the month and the model performance and repeat the investigation by dividing the dataset into to period of equal size to check if the system is stationnary.
%% Cell type:markdown id:official-asian tags:
%% Cell type:markdown id:sublime-yugoslavia tags:
## **Indicators : RMSE and Nashsutcliff coefficients**
#### Importing additional package and functions
%% Cell type:code id:phantom-welsh tags:
%% Cell type:code id:overhead-montgomery tags:
``` python
#from analysis_functions.py import * # RMSE and Nash functions
# Converting to pandas dataframe for faster iteration
df=ds.to_dataframe()
E_meas=df["E_meas"].to_numpy()
Ea_scen1=df["Ea_scen1"].to_numpy()
# removing tuples that are nan values in at least one of the two time series
mask=np.isnan(E_meas)+np.isnan(Ea_scen1)
Ea_scen1=Ea_scen1[np.where(~mask)]
E_meas=E_meas[np.where(~mask)]
```
%% Cell type:code id:fourth-saint tags:
%% Cell type:code id:lovely-prefix tags:
``` python
# compute the RMSE and NS coefficients of the modeled time series :
RMSE_model=RMSE(E_meas,Ea_scen1)
NS_model=NS(E_meas,Ea_scen1)
print(f'RMSE coefficient value : {RMSE_model}')
print(f'Nash Sutcliff coefficient value : {NS_model}')
S=np.size(E_meas)
Index=np.arange(0,S,1)
# bootstrapping part
# number of resample
M=1000
# optimal length for block boostrapping
b_star=optimal_block_length(E_meas)
b_star_sb=math.ceil(b_star[0].b_star_sb)
print(f'optimal block length for stationary bootstrap = {b_star_sb}')
Index_resample=stationary_bootstrap(Index,block_length=b_star_sb,replications=M)# get how all the index are shuffled using the stationnary bootstrap algorithm
```
%%%% Output: stream
RMSE coefficient value : 6.288465029448806e-05
Nash Sutcliff coefficient value : -0.30422232059609433
optimal block length for stationary bootstrap = 1458