Skip to content

Commit

Permalink
Add figures to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
thouska committed Sep 25, 2020
1 parent b1bc7e0 commit ad10c09
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docs/Sensitivity_analysis_with_FAST.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ The algorithm will tell you, how sensitive your parameters are based on whatever
iterations you need to get an reliable information about your parameter. The number of iteration can be calculate after [Henkel et al. GLOBAL SENSITIVITY ANALYSIS OF NONLINEAR MATHEMATICAL MODELS - AN
IMPLEMENTATION OF TWO COMPLEMENTING VARIANCE-BASED ALGORITHMS, 2012] (https://www.informs-sim.org/wsc12papers/includes/files/con308.pdf):

$$N = (1+4M^2(1+(k-2)d))k$$
$$N = (1+4M^2(1+(k-2)d))k$$

with N = needed parameter iterations, M= inference factor (SPOTPY default M=4) and d= frequency step (SPOTPY default d=2) and k as the number of parameters of your model.

Expand Down
Binary file added docs/img/DREAM_parameter_uncertainty_Hymod.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/DREAM_r_hat.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/DREAM_simulation_uncertainty_Hymod.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 7 additions & 5 deletions spotpy/examples/tutorial_dream_hymod.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
acceptance_test_option = 6

sampler=spotpy.algorithms.dream(spot_setup, dbname='DREAM_hymod', dbformat='csv')
#r_hat = sampler.sample(rep, nChains, nCr, eps, convergence_limit,
# runs_after_convergence,acceptance_test_option)
r_hat = sampler.sample(rep, nChains, nCr, eps, convergence_limit,
runs_after_convergence,acceptance_test_option)



Expand All @@ -57,15 +57,17 @@
ax = plt.subplot(1,1,1)
q5,q25,q75,q95=[],[],[],[]
for field in fields:
q5.append(np.percentile(results[field][-100:-1],2.5))
q95.append(np.percentile(results[field][-100:-1],97.5))
q5.append(np.percentile(results[field][-100:-1],2.5))# ALl 100 runs after convergence
q95.append(np.percentile(results[field][-100:-1],97.5))# ALl 100 runs after convergence
ax.plot(q5,color='dimgrey',linestyle='solid')
ax.plot(q95,color='dimgrey',linestyle='solid')
ax.fill_between(np.arange(0,len(q5),1),list(q5),list(q95),facecolor='dimgrey',zorder=0,
linewidth=0,label='parameter uncertainty')
linewidth=0,label='simulation uncertainty')
ax.plot(spot_setup.evaluation(),color='red', markersize=2,label='data')
ax.set_ylim(-50,450)
ax.set_xlim(0,729)
ax.set_ylabel('Discharge [l s-1]')
ax.set_xlabel('Days')
ax.legend()
fig.savefig('DREAM_simulation_uncertainty_Hymod.png',dpi=150)
#########################################################
Expand Down

0 comments on commit ad10c09

Please sign in to comment.