Description Objects from the Class Slots Extends Accessor methods Methods UML class diagram Author(s) References See Also Examples

Class for controlling contamination in a simulation experiment. The values
of the first observations will either be *contaminated completely at
random* (CCAR; i.e., not depending on the original values) or
*contaminated at random* (CAR; i.e., depending on the original values).

Objects can be created by calls of the form `BasicContControl(...)`

or
`ContControl(..., sub = "Basic")`

.

`target`

:A character vector specifying specifying the variables (columns) to be contaminated, or

`NULL`

to contaminate all variables (except additional ones generated internally).`epsilon`

:A numeric vector giving the contamination levels.

`tuning`

:A data frame giving tuning parameters for the contamination. A list is converted to a data frame during initialization via

`expand.grid`

.`indices`

:An integer matrix in which the first column contains the indices of the contamination levels and the second column contains the row indices of the tuning parameters for the different contamination settings.

`fun`

:A function generating the values of the contaminated data. As its first argument, it should take either the number of observations to be created (if

`type`

is`"CCAR"`

) or the original values of the observations to be contaminated (if`type`

is`"CAR"`

). Furthermore, it should return an object that can be coerced to a data frame, containing the contaminated data.`dots`

:A list containing additional arguments to be passed to

`fun`

.`type`

:A character string specifying whether observations should be contaminated completely at random (

`"CCAR"`

) or contaminated at random (`"CAR"`

).

Class `"ContControl"`

, directly.
Class `"VirtualContControl"`

, distance 2.
Class `"OptContControl"`

, distance 3.

Accessor methods are inherited.

The following methods are available in addition to the inherited ones:

`contaminate`

`signature(x = "data.frame", control = "BasicContControl")`

: contaminate data.

A slightly simplified UML class diagram of the framework can be found in
Figure 1 of the package vignette *An Object-Oriented Framework for
Statistical Simulation: The R Package simFrame*. Use

`vignette("simFrame-intro")`

to view this vignette.
Andreas Alfons

Alfons, A., Templ, M. and Filzmoser, P. (2010) An Object-Oriented Framework for
Statistical Simulation: The **R** Package simFrame. *Journal of
Statistical Software*, **37**(3), 1–36. URL
http://www.jstatsoft.org/v37/i03/.

1 2 3 4 | ```
x <- generate(size = 10)
cc <- ContControl(epsilon = 0.2, fun = function(x) x * 10,
type = "CAR", sub = "Basic")
contaminate(x, cc)
``` |

aalfons/simFrame documentation built on June 3, 2017, 10:52 a.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.