| generate {simFrame} | R Documentation |
Generic function for generating data based on a (distribution) model.
generate(control, ...) ## S4 method for signature 'DataControl': generate(control)
control |
a control object inheriting from the virtual class
"VirtualDataControl" or a character string specifying such a
control class (the default being "DataControl"). |
... |
if control is a character string or missing, the slots of
the control object may be supplied as additional arguments. |
The control class "DataControl" is quite simple but general. For
user-defined data generation, it often suffices to implement a function and
use it as the distribution slot in the "DataControl" object.
See "DataControl" for some requirements for such a
function.
However, if more specialized data generation models are required, e.g., for
adding contamination already in the data generation process, the framework
can be extended by defining a control class "MyDataControl" extending
"VirtualDataControl" and the corresponding method
generate(control) with signature 'MyDataControl'.
A data.frame.
Andreas Alfons, alfons@statistik.tuwien.ac.at
DataControl, VirtualDataControl
require(MASS)
mu <- rep(0, 2)
Sigma <- matrix(c(1, 0.5, 0.5, 1), 2, 2)
generate(size = 10, distribution = mvrnorm,
dots = list(mu = mu, Sigma = Sigma))