Tools

Documentation of all functions defined within the rrmpg.tools module.

Monte-Carlo

rrmpg.tools.monte_carlo.monte_carlo(model, num, qobs=None, **kwargs)[source]

Perform Monte-Carlo-Simulation.

This function performs a Monte-Carlo-Simulation for any given hydrological model of this repository.

Parameters
  • model – Any instance of a hydrological model of this repository.

  • num – Number of simulations.

  • qobs – (optional) Array of observed streamflow.

  • **kwargs – Keyword arguments, matching the inputs the model needs to perform a simulation (e.g. qobs, precipitation, temperature etc.). See help(model.simulate) for model input requirements.

Returns

A dictonary containing the following two keys [‘params’, ‘qsim’]. The key ‘params’ contains a numpy array with the model parameter of each simulation. ‘qsim’ is a 2D numpy array with the simulated streamflow for each simulation. If an array of observed streamflow is provided, one additional key is returned in the dictonary, being ‘mse’. This key contains an array of the mean-squared-error for each simulation.

Raises
  • ValueError – If any input contains invalid values.

  • TypeError – If any of the inputs has a wrong datatype.