| dict_mutators_gauss {miesmuschel} | R Documentation |
Gaussian Distribution Mutator
Description
Individuals are mutated with an independent normal random variable on each component.
Configuration Parameters
-
sdev::numeric
Standard deviation of normal distribuion. This is absolute ifsdev_is_relativeisFALSE, and multiplied with each individual component's range (upper - lower) ifsdev_is_relativeisTRUE. This may either be a scalar, in which case it is applied to all input components, or a vector, in which case it must have the length of the input and applies to components in order in which they appear in the primingParamSet. Must be set by the user. -
sdev_is_relative::logical(1)
Whethersdevis absolute (FALSE) or relative to component range (TRUE). Initialized toFALSE. -
truncated_normal::logical(1)
Whether to draw individuals from a normal distribution that is truncated at the bounds of each component (TRUE), or to draw from a normal distribution and then restrict to bounds afterwards (FALSE). The former (TRUE) will lead to very few to no samples landing on the exact bounds (analytically it would be none almost surely, but this is subject to machine precision), the latter (FALSE) can lead to a substantial number of samples landing on the exact bounds. Initialized toFALSE.
Supported Operand Types
Supported Domain classes are: p_int ('ParamInt'), p_dbl ('ParamDbl')
Dictionary
This Mutator can be created with the short access form mut()
(muts() to get a list), or through the the dictionary
dict_mutators in the following way:
# preferred:
mut("gauss")
muts("gauss") # takes vector IDs, returns list of Mutators
# long form:
dict_mutators$get("gauss")
Super classes
miesmuschel::MiesOperator -> miesmuschel::Mutator -> miesmuschel::MutatorNumeric -> MutatorGauss
Methods
Public methods
Inherited methods
Method new()
Initialize the MutatorGauss object.
Usage
MutatorGauss$new()
Method clone()
The objects of this class are cloneable with this method.
Usage
MutatorGauss$clone(deep = FALSE)
Arguments
deepWhether to make a deep clone.
See Also
Other mutators:
Mutator,
MutatorDiscrete,
MutatorNumeric,
OperatorCombination,
dict_mutators_cmpmaybe,
dict_mutators_erase,
dict_mutators_maybe,
dict_mutators_null,
dict_mutators_proxy,
dict_mutators_sequential,
dict_mutators_unif
Examples
set.seed(1)
mg = mut("gauss", sdev = 0.1)
p = ps(x = p_int(-5, 5), y = p_dbl(-5, 5))
data = data.frame(x = rep(0, 5), y = rep(0, 5))
mg$prime(p)
mg$operate(data)
mg$param_set$values$sdev = 100
mg$operate(data)