dummyalgo {CAISEr} | R Documentation |
Dummy algorithm routine to test the sampling procedures
Description
This is a dummy algorithm routine to test the sampling procedures, in
combination with dummyinstance()
.
dummyalgo()
receives two parameters that determine the distribution of
performances it will exhibit on a hypothetical problem class:
distribution.fun
(with the name of a random number generation function,
e.g. rnorm
, runif
, rexp
etc.); and distribution.pars
, a named list of
parameters to be passed on to distribution.fun
.
The third parameter is an instance object (see calc_nreps()
for details),
which is a named list with the following fields:
FUN = "dummyinstance"
- must always be "dummyinstance" (will be ignored otherwise).distr
- the name of a random number generation function....
- other named fields with parameters to be passed down to the function indistr
.
Usage
dummyalgo(
distribution.fun = "rnorm",
distribution.pars = list(mean = 0, sd = 1),
instance = list(FUN = "dummyinstance", distr = "rnorm", mean = 0, sd = 1)
)
Arguments
distribution.fun |
name of a function that generates random values according to a given distribution, e.g., "rnorm", "runif", "rexp" etc. |
distribution.pars |
list of named parameters required by the function
in |
instance |
instance parameters (see |
Details
distribution.fun
and distribution.pars
regulate the mean performance of
the dummy algorithm on a given (hypothetical) problem class, and the
between-instances variance of performance. The instance specification in
instance
regulates the within-instance variability of results. Ideally the
distribution parameters passed to the instance
should result in a
within-instance distribution of values with zero mean, so that the mean of
the values returned by dummyalgo
is regulated only by distribution.fun
and distribution.pars
.
The value returned by dummyalgo is sampled as follows:
offset <- do.call(distribution.fun, args = distribution.pars) y <- offset + do.call("dummyinstance", args = instance)
Value
a list object with a single field $value
, containing a scalar
numerical value distributed as described at the end of Details
.
Author(s)
Felipe Campelo (fcampelo@ufmg.br, f.campelo@aston.ac.uk)
See Also
Examples
# Make a dummy instance with a centered (zero-mean) exponential distribution:
instance = list(FUN = "dummyinstance", distr = "rexp", rate = 5, bias = -1/5)
# Simulate a dummy algorithm that has a uniform distribution of expected
# performance values, between -25 and 50.
dummyalgo(distribution.fun = "runif",
distribution.pars = list(min = -25, max = 50),
instance = instance)