| SimControl-class {simFrame} | R Documentation |
Class for controlling how simulation runs are performed.
Objects can be created by calls of the form new("SimControl", ...) or
SimControl(...).
contControl:"OptContControl"; a
control object for contamination, or NULL.NAControl:"OptNAControl"; a control
object for inserting missing values, or NULL.design:"character" specifying the
variables (columns) to be used for splitting the data into domains. The
simulations, including contamination and the insertion of missing values
(unless SAE=TRUE), are then performed on every domain.fun:"function" to be applied in each
simulation run.dots:"list" containing additional
arguments to be passed to fun.SAE:"logical" indicating whether
small area estimation will be used in the simulation.
There are some requirements for fun. It must return a numeric vector
or an object of class "SimResult", which consists of a slot
values (a numeric vector) and a slot add (additional
results of any class, e.g., statistical models). Note that the latter
is computationally more expensive. Returning a list with components
values and add is also accepted and slightly faster than using
a "SimResult" object. A data.frame is passed to
fun in every simulation run. The corresponding argument must be
called x. If comparisons with the original data need to be made,
e.g., for evaluating the quality of imputation methods, the function should
have an argument called orig. If different domains are used in the
simulation, the indices of the current domain can be passed to the function
via an argument called domain.
For small area estimation, the following points have to be kept in mind. The
design for splitting the data must be supplied and SAE
must be set to TRUE. However, the data are not actually split into
the specified domains. Instead, the whole data set (sample) is passed to
fun. Also contamination and missing values are added to the whole
data (sample). Last, but not least, the function must have a domain
argument so that the current domain can be extracted from the whole data
(sample).
In every simulation run, fun is evaluated using try. Hence
no results are lost if computations fail in any of the simulation runs.
signature(cl = "ANY", x = "data.frame",
setup = "VirtualSampleControl", nrep = "missing",
control = "SimControl"): run a simulation experiment on a snow
cluster.signature(cl = "ANY", x = "data.frame",
setup = "SampleSetup", nrep = "missing", control = "SimControl"): run a
simulation experiment on a snow cluster.signature(cl = "ANY",
x = "VirtualDataControl", setup = "missing", nrep = "numeric",
control = "SimControl"): run a simulation experiment on a snow
cluster.signature(x = "data.frame",
setup = "VirtualSampleControl", nrep = "missing",
control = "SimControl"): run a simulation experiment.signature(x = "data.frame",
setup = "SampleSetup", nrep = "missing", control = "SimControl"): run a
simulation experiment.signature(x = "data.frame", setup = "missing",
nrep = "numeric", control = "SimControl"): run a simulation experiment.signature(x = "data.frame", setup = "missing",
nrep = "missing", control = "SimControl"): run a simulation experiment.signature(x = "VirtualDataControl",
setup = "missing", nrep = "numeric", control = "SimControl"): run a
simulation experiment.signature(x = "VirtualDataControl",
setup = "missing", nrep = "missing", control = "SimControl"): run a
simulation experiment.Andreas Alfons, alfons@statistik.tuwien.ac.at
showClass("SimControl")