generate {simFrame}R Documentation

Generate data

Description

Generic function for generating data based on a (distribution) model.

Usage

generate(control, ...)

## S4 method for signature 'DataControl':
generate(control)

Arguments

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.

Details

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'.

Value

A data.frame.

Author(s)

Andreas Alfons, alfons@statistik.tuwien.ac.at

See Also

DataControl, VirtualDataControl

Examples

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))

[Package simFrame version 0.1.1 Index]