Commit c0557038 authored by Delaigue Olivier's avatar Delaigue Olivier
Browse files

docs(vignette): fix a misspelled variable in the param_optim vignette

parent e5476696
Pipeline #21724 passed with stages
in 8 minutes and 9 seconds
......@@ -57,6 +57,7 @@ Regarding the different optimization strategies presented here, we refer to each
Please note that this vignette is only for illustration purposes and does not provide any guidance about which optimization strategies is recommended for the family of the **GR** models.
## Definition of the necessary function
Parameter estimation can be performed by defining a function that takes a parameter set as input and returns the value of the performance criterion.
......@@ -90,6 +91,8 @@ lowerGR4J <- rep(-9.99, times = 4)
upperGR4J <- rep(+9.99, times = 4)
```
# Local optimization
We start with a local optimization strategy by using the PORT routines (using the `nlminb()` of the `stats` package) and by setting a starting point in the transformed parameter space:
......@@ -109,9 +112,9 @@ Here we use the same grid used for the filtering step of the Michel's calibratio
For each starting point, a local optimization is performed.
```{r, warning=FALSE, results='hide', eval=FALSE}
StarttGR4JDistrib <- TransfoParam_GR4J(ParamIn = CalibOptions$StartParamDistrib,
startGR4JDistrib <- TransfoParam_GR4J(ParamIn = CalibOptions$StartParamDistrib,
Direction = "RT")
startGR4J <- expand.grid(data.frame(StarttGR4JDistrib))
startGR4J <- expand.grid(data.frame(startGR4JDistrib))
optPORT_ <- function(x) {
opt <- stats::nlminb(start = x,
objective = OptimGR4J,
......@@ -138,6 +141,7 @@ summary(resPORT)
The existence of several local minima illustrates the importance of defining an appropriate starting point or of using a multi-start strategy or a global optimization strategy.
# Global optimization
Global optimization is most often used when facing a complex response surface, with multiple local mimina.
......@@ -147,6 +151,7 @@ Here we use the following R implementation of some popular strategies:
* [hydroPSO: particle swarm](https://cran.r-project.org/package=hydroPSO)
* [Rmalschains: memetic algorithms](https://cran.r-project.org/package=Rmalschains)
## Differential Evolution
```{r, warning=FALSE, results='hide', eval=FALSE}
......@@ -164,6 +169,7 @@ optPSO <- hydroPSO::hydroPSO(fn = OptimGR4J,
control = list(write2disk = FALSE, verbose = FALSE))
```
## MA-LS-Chains
```{r, warning=FALSE, results='hide', eval=FALSE}
......@@ -172,6 +178,8 @@ optMALS <- Rmalschains::malschains(fn = OptimGR4J,
maxEvals = 2000)
```
# Results
As it can be seen in the table below, the four additional optimization strategies tested lead to very close optima.
......@@ -230,6 +238,7 @@ MOptimGR4J <- function(i) {
}
```
## caRamel
caRamel is a multiobjective evolutionary algorithm combining the MEAS algorithm and the NGSA-II algorithm.
......@@ -288,6 +297,3 @@ ggplot() +
scale_y_sqrt() +
theme_bw()
```
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment