Particle Swarm Optimisation (PSO) is a recent and powerful population-based stochastic optimisation technique inspired by social behaviour of bird flocking and shares few similarities with other evolutionary techniques such as Genetic Algorithms (GA). In PSO, however, each individual of the population, termed particle in PSO terminology, adjusts its flying trajectory on the multi-dimensional search-space according to its own experience (best-known previous position) and the one of all particles in swarm (best-known global position). PSO has recently received a surge of attention given its flexibility, ease of programming, low memory and CPU requirements, and efficiency. Albeit these advantages, PSO may still get trapped into sub-optimal solutions, experience swarm explosion or convergence problems and, thus, the development and enhancements to the canonical PSO are active areas of research. To date, several modifications to the “canonical” PSO have been proposed in the literature resulting into a large and dispersed collection of codes and algorithms which might well be used for similar if not identical purposes.
In this work we present hydroPSO, a platform-independent R package implementing several enhancements to the canonical PSO that we consider of utmost importance to bring this technique to the attention of a broader community of scientists and practitioners. hydroPSO is model-independent, allowing the user to interface any model code with the calibration engine without having to invest considerable effort in customizing PSO to a new calibration problem. Some of the controlling options to fine-tune hydroPSO are: four alternative topologies, several types of inertia weight schemes, time-variant acceleration coefficients, time-variant maximum velocity, regrouping of particles when premature convergence is detected, different types of boundary conditions and many others.
Additionally, hydroPSO implements recent PSO variants such as: Improved Particle Swarm Optimisation (IPSO), Fully Informed Particle Swarm (FIPS), and weighted FIPS (wFIPS). Finally, an advanced sensitivity analysis using the Latin Hypercube One-At-a-Time (LH-OAT) method and user-friendly plotting summaries facilitate the
interpretation and assessment of the calibration/optimisation results.
We validate hydroPSO against the standard PSO algorithm (SPSO-2007) employing five test functions commonly used to assess the performance of optimisation algorithms. Additionally, we illustrate how the performance of the optimization/calibration engine is boosted by using several of the fine-tune options included in hydroPSO. Finally, we show how to interface SWAT-2005 with hydroPSO to calibrate a semi-distributed hydrological model for the Ega River basin in Spain, and how to interface MODFLOW-2000 and hydroPSO to calibrate a groundwater flow model for the regional aquifer of the Pampa del Tamarugal in Chile.
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
hydroPSO: A Versatile Particle Swarm Optimisation R Package for Calibration of Environmental Models (EGU 2012)
1. hydroPSO: A Versatile Particle Swarm Optimisation R Package for
Joint
hydroPSO: A Versatile Particle Swarm Optimisation R Package for Research
Centre
Calibration of Environmental Models
Calibration of Environmental Models EGU2012-10950
Session: HS3.3
Mauricio Zambrano-Bigiarini and Rodrigo Rojas
Mauricio Zambrano-Bigiarini and Rodrigo Rojas Apr 25th, 2012
1) Motivation 5) Fine-tuning Options 6) hydroPSO Main Functions
Parameter optimisation techniques are generally hydroPSO Function Short Description
PSO Parameter Value(s)
implemented in customised pieces of (proprietary) Option
lhoat() Sensitivity analysis using LH-OAT (van Griensven et al.,2006)
software, which have to be strongly modified to set up the linear, non-linear, adaptive
use.IW inertia weight factor (aiwf), hydromod() Run the model code to be calibrated
calibration of alternative environmental models. ω IW.type global-local best ratio,
random
hydroPSO() Platform- and model-independent PSO calibration engine
The latter deprives the user of the flexibility to easily reuse c1 c1,use.TVc1, linear, non-linear, global-local read_results() Reading hydroPSO() results. It is a wrapper to:
TVc2.type best ratio
existing calibration codes without having to invest read_particles() Reading ”Particles.txt” output file
c2 c2,use.TVc2,
linear, non-linear
considerable time and effort. TVc2.type read_velocities() Reading ”Velocities.txt” output file
Boundary absorbing, invisible,
condition
boundary.wall
reflecting, damping
read_out() Reading ”Model_output.txt” output file
Regrouping use.RG TRUE/FALSE read_convergence() Reading ”ConvergenceMeasures.txt” output file
2) Aim Initial positions Xini.type random, lhs read_GofPerParticle() Reading ”Particles_GofPerIter.txt” output file
Initial velocites Vini.type random, lhs, zero
To present and illustrate the application of hydroPSO, a plot_results() Plotting hydroPSO()results. It is a wrapper to:
Updates best.update synchronous, asynchronous
new global optimisation R package specifically designed Maximum use.TVlambda, plot_particles() Plotting sampled parameters (histograms, dotty plots, ...)
linear, non-linear
to calibrate complex real-world environmental models. velocity TVlambda.type
plot_velocities() Plotting evolution of particle velocities
gbest, lbest, vonNeumann,
Topology topology plot_out() Plotting model outputs against observations
random
PSO variant method pso, fips, wfips, ipso plot_convergence() Plotting convergence measures (optimum and swarm radious)
3) hydroPSO: Key Features plot_GofPerParticle() Plotting the evolution of the goodness-of-fit per each particle
verification() Runs the model code with one or more parameter sets
●
Model-independent test_functions() Six n-dimensional benchmark functions included: Sphere,
●
Multi-platform (GNU/Linux, Windows, Mac OS X) Rosenbrock, Rastrigin, Griewank, Ackley and Schaffer F6.
●
State-of-the-art Particle Swarm Optimisation (PSO) as Useful to test the PSO configuration performance for different
calibration engine types of calibration problems.
●
Minimal user intervention to interface the model code
with the calibration engine
Fig 02. Dotty plots showing the model performance versus parameter
values, for three selected parameters (SWAT-2005 case study). Vertical
7) Case Studies
●
Easy plotting of results red line indicates the optimum parameter value. Application Feature SWAT-2005 Modflow-2005
●
Sensitivity analysis by using the Latin-Hypercube One- Platform GNU/Linux Windows 7
Fig 01. Interactions among the main hydroPSO functions. User-defined files ParamRanges.txt and
factor-At-a-Time (LH-OAT, van Griensven et al., 2006) ParamFiles.txt defines which parameters are to be calibrated and where they have to be modified, Type of model Semi-distributed, surface Fully-distributed, groundwater
respectively. R functions out.FUN() and gof.FUN() are used along with observations to read model outputs hydrology
●
Calibration engine validated against the Standard PSO and to assess model performance, respectively. Light-blue shaded boxes indicate some user intervention.
2007 (SPSO 2007, Clerc 2011) hydroPSO-model Basic, through available R Advanced, through user-defined
interface functions R functions
●
Several fine-tuning options and PSO variants to tackle
Executable model code Single file (swat2005.out) Sequential batch file (*.bat)
different kinds of optimisation problems Fig 03. Evolution of parameter values along number of model
Simulated model outputs Continuous-time, single-site Steady-state, multi-site
●
Open-source code (GPL >=2) evaluations for three selected parameters (SWAT-2005 case study).
Goodness-of-fit measure Pre-defined Nash-Sutcliffe User-defined Gaussian
●
Binaries, user manual, and vignette (tutorial) are efficiency Likelihood
available on http://www.rforge.net/hydroPSO/
8) Concluding Remarks
4) Particle Swarm Optimisation (PSO) ●
hydroPSO provides an efficient and ready-to-use global optimisation engine for the
calibration of different environmental models
PSO (Kennedy and Eberhart, 1995) is a ●
hydroPSO allows to carry out a typical modelling exercise: sensitivity analysis, model
population-based stochastic calibration and assessment of results
optimisation technique inspired by ●
For specific problems, a customised PSO configuration will have a significant impact on the
the social behaviour of bird flocking. optimisation results
●
Results in two case studies show that hydroPSO is effective and efficient in finding optimal
Each individual of the population adjuts its flying trajectory solutions compared to intensive MCMC-based techniques
around the multi-dimensional search space according to its ●
hydroPSO shows an outstanding flexibility to tackle several types of optimisation problems
own flying experience (local search) and that of commonly faced by the modelling community (see point 7)
neighbouring particles (global search): ●
Given the versatility added by the R environment and the large amount of packages
local search global search available, we believe hydroPSO can be applied to a wide class of environmental models
requiring some form of parameter optimisation
V i t 1 = V i t c1 U 1t P 1 − X it c2 U 2t G − X i t
9) Ongoing research:
X i t 1 = X i t V i t 1 Fig 04. Evolution of the global optimum (Gaussian likelihood) and the ●
Multi-core/parallel support, to alleviate the computational burden
normalised swarm radious (δnorm) along the iterations (Modflow-2005
ω : inertia weigth
Multi-objective implementation, to tackle a wider class of optimisation problems
●
● X i t : i-th particle position at iteration t case study). ●
● c1 : cognitive aceleration coefficient
References:
t
● V i : i-th particle velocity at iteration t
● c2 : social aceleration coefficient
● P i : i-th particle best-known position
● U 1 t, U 2 t: independent and uniformly Fig 05. Gaussian likelihood response surface projected onto the parameter space (pseudo 3D-dotty ●
Zambrano-Bigiarini, M., and R. Rojas (2012), hydroPSO: A model-independent particle swarm optimization software for calibration of environmental models,
● G : neighbourhood best-known position plots) for selected parameters. Panels show “behavioural” samples with L > 3.8x10-2. For a subset of Environmental Modelling & Software, submitted
distributed random vectors
parameters (Modflow-2005 case study). ●
Kennedy, J., and R. Eberhart (1995), Particle swarm optimization, in Proceedings IEEE International Conference on Neural Networks, 1995, vol. 4, pp. 1942–
1948, doi: 10.1109/ICNN.1995.488968.
Mauricio Zambrano-Bigiarini and Rodrigo Rojas
www.jrc.europa.eu
●
Clerc, M., 2011. Standard particle swarm optimisation. http://clerc.maurice.free.fr/pso/SPSO_descriptions.pdf. [Online; last accessed Apr-2011].
European Commission • Joint Research Centre • Institute for Environment and Sustainability ●
van Griensven, A., T. Meixner, S. Grunwald, T. Bishop, M. Diluzio, and R. Srinivasan (2006), A global sensitivity analysis tool for the parameters of multi-
variable catchment models, Journal of Hydrology, 324 (1–4), 10–23, doi: 10.1016/j.jhydrol.2005.09.008.
Tel. +39 0332 789588 • Email: mauricio.zambrano@jrc.ec.europa.eu