class documentation

noise wrapper for an observed problem.

The noise is applied with different probabilities for

  • subtracting a value (leading to good outliers)
  • adding a value (leading to bad outliers)
  • adding a small epsilon normally distributed noise

The noise is frozen in x and y: whether it's applied and its sampled value depend deterministically on the input x and i.

The outlier noise distribution is a Cauchy distribution multiplied by pi/2, which generates values larger than k with a probability awfully close to k**-1 when k >= 10.

Example:

import cocoex  # experimentation module
import scipy  # to define the solver to be benchmarked

### input
suite_name = "bbob"
fmin = scipy.optimize.fmin  # optimizer to be benchmarked

### prepare
suite = cocoex.Suite(suite_name, "", "")
observer = cocoex.Observer(suite_name, "")

### go
for problem in suite:  # this loop may take several minutes or more
    problem.observe_with(observer)  # generates the data for cocopp
    problem = cocoex.noiser.Noisifier().noisify(problem)  # a Noisifier
    fmin(problem, problem.initial_solution, disp=False)

The problem is now a Noisifier but it still abides by the interface of the original problem.

Details: the random number generators can be passed as argument and need to obey the interface of noiser.rand. rands[0] is assumed to be uniform in [0,1], rands[1] is used to sample the Gaussian noise, abs(rands[2]) is used to sample added noise and abs(rands[-1]) is used to sample subtracted noise, both of which are assumed to be absolute Cauchy numbers scaled by pi/2 such that P(number > a) equals about 1/a when a >= 5.

See https://github.com/numbbo/coco-experiment/blob/main/build/python/example/example_experiment_complete.py

Method __call__ Undocumented
Method __getattr__ pretend to be a COCO problem as passed in noisify
Method __init__ constructor with 4 optional parameters for the noise model,
Method constraint return noisy constraint values
Method noisify wrap problem with frozen noise
Method rand1 Undocumented
Method rand2 Undocumented
Method rand3 Undocumented
Property parameters Undocumented
Method _cnoise Undocumented
Method _dump_params Undocumented
Method _fnoise x-dependent abs Cauchy noise with median pi/2
Method _load_params Undocumented
Method _set_params set parameters from file filename
Instance Variable _params Undocumented
Instance Variable _problem Undocumented
def __call__(self, x):

Undocumented

def __getattr__(self, name):

pretend to be a COCO problem as passed in noisify

def __init__(self, p_add=0.2, p_subtract=0.0, p_epsilon=0, epsilon=0.0001, rands=(rand, randn, randc)):

constructor with 4 optional parameters for the noise model,

p_add: probability for adding a positive heavy tail random value

p_subtract: probability for subtracting a positive heavy tail random value

p_epsilon: probability for adding a Gaussian random value

epsilon: standard deviation of the Gaussian random value

def constraint(self, x):

return noisy constraint values

def noisify(self, problem):

wrap problem with frozen noise

def rand1(self, x, fac=1):

Undocumented

def rand2(self, x, fac=1):

Undocumented

def rand3(self, x, fac=1):

Undocumented

@property
parameters =

Undocumented

def _cnoise(self, x):

Undocumented

def _dump_params(self):

Undocumented

def _fnoise(self, x):

x-dependent abs Cauchy noise with median pi/2

def _load_params(self, filename=parameters_file, warn_errors=(FileNotFoundError), ignore_errors=()):

Undocumented

def _set_params(self, filename=parameters_file, **kwargs):

set parameters from file filename

_params =

Undocumented

_problem =

Undocumented