The hardware and bandwidth for this mirror is donated by METANET, the Webhosting and Full Service-Cloud Provider.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]metanet.ch.

sceua

R-CMD-check

sceua provides R bindings to a Rust implementation of the Shuffled Complex Evolution - University of Arizona (SCE-UA) global optimisation algorithm (Duan et al., 1992).

SCE-UA combines deterministic simplex search, competitive evolution, and periodic shuffling of parallel complexes. It is designed for nonlinear, non-convex, continuous parameter estimation problems and is widely used in hydrological model calibration.

Installation

Install the released version from CRAN:

# Not yet available
# install.packages("sceua")

Or the development version from GitHub:

# install.packages("pak")
pak::pak("atsyplenkov/sceua/r")

Building from source requires a Rust toolchain.

Example

Minimise a simple sphere function:

library(sceua)
set.seed(1969)
result <- sceua(
  fn = function(x) sum(x^2),
  lower = c(-5, -5),
  upper = c(5, 5),
  max_evaluations = 5000,
  kstop = 5,
  pcento = 1e-8,
  complexes = 5
)

result
#> <sceua>
#> best value:    4.13437e-11
#> evaluations:   625
#> iterations:    15
#> termination:   parameter_convergence
#> best parameters:
#> [1] -5.857289e-06 -2.652528e-06

Pass extra arguments to the objective:

fn <- function(x, target) sum((x - target)^2)
set.seed(1969)
result <- sceua(
  fn = fn,
  lower = c(-5, -5),
  upper = c(5, 5),
  target = c(1, 2),
  max_evaluations = 5000
)

result$par
#> [1] 1.000273 1.999246

Algorithm parameters

The most commonly tuned parameters are:

See ?sceua for full details.

References

Duan, Q., Sorooshian, S., and Gupta, V.K., 1992. Effective and efficient global optimization for conceptual rainfall-runoff models. Water Resources Research 28 (4), 1015-1031.

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.