seibert.breed: Combine two values of a parameter type using weighted...

Description Usage Arguments Value References Examples

View source: R/gap_seibert.R

Description

Combine two values of a parameter type using weighted probabilities

Usage

1
2
3
seibert.breed(param, value1, value2, prob = list(breed.use1 = 0.41, breed.use2
  = 0.41, breed.rinterpolate = 0.16, breed.mutate = 0.02), seed = NULL,
  cols = "result", validate = TRUE)

Arguments

param

A 'param' object

value1

The first value

value2

The second value

prob

A named list in the form functionname=probability. The function described by functionname should take the parameter as its first argument and (at least) two vector parameters of arbitrary length and return a vector of identical length. Examples include breed.use1, breed.use2, breed.rinterpolate, and breed.mutate.

seed

A random number seed for replicability.

cols

A combination of 'result', 'func', 'value1', and/or 'value2'. Passing multiple column names will result in a data.frame; passing a single column will result in a vector. This is helpful for debugging.

validate

TRUE to validate arguments, FALSE otherwise. In most cases this function gets called hundreds to thousands of times using values that were generated by the function itself. Using validation may help track down bugs when unexpected output occurs.

Value

A vector of new parameter values, or a data.frame if multiple cols are passed.

References

Seibert, J. 2000. Multi-criteria calibration of a conceptual runoff model using a generic algorithm. Hydrology and Earth System Sciences 4(2): 215<e2><80><93>224.

Examples

1
2
3
4
p <- param.discrete(c('heads', 'tails', 'edge of coin'), weights=c(0.45, 0.45, 0.1))
v1 <- random.value(p, n=10)
v2 <- random.value(p, n=10)
seibert.breed(p, v1, v2, cols=c('value1', 'value2', 'func', 'result'))

paleolimbot/easyoptim documentation built on May 24, 2019, 6:12 p.m.