generate(simFrame)
generate()所属R语言包:simFrame
Generate data
生成数据
译者:生物统计家园网 机器人LoveR
描述----------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").
控制对象从虚拟类"VirtualDataControl"或一个字符串指定控制类(默认是"DataControl")继承。
参数:...
if control is a character string or missing, the slots of the control object may be supplied as additional arguments. See "DataControl" for details on the slots.
如果control是一个字符串或丢失,控制对象的插槽,可以提供额外的参数。见"DataControl"的插槽。
Details
详细信息----------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.
控制类"DataControl"是很简单,但是一般。对于用户定义的数据生成,它通常足以实现一个功能,并使用它作为distribution插槽"DataControl"对象。见"DataControl"这样的功能的一些要求。
However, if more specialized data generation models are required, the framework can be extended by defining a control class "MyDataControl" extending "VirtualDataControl" and the corresponding method generate(control) with signature 'MyDataControl'. If, e.g., a specific distribution or mixture of distributions is frequently used in simulation experiments, a distinct control class may be more convenient for the user.
但是,如果需要更专业的数据生成模型,可扩展的框架定义的控件类"MyDataControl"延长"VirtualDataControl"和相应的方法generate(control)的签名'MyDataControl'。“如果,例如,一个特定的分布的分布或混合物经常使用在模拟实验中,一个完全不同的控制类可能是更方便了用户。
值----------Value----------
A data.frame.
Adata.frame。
方法----------Methods----------
control = "character" generate data using a control class specified by the character string control. The slots of the control
control = "character"产生使用控制类指定的字符串control的数据。时隙的控制中
control = "missing" generate data using a control object of class "DataControl". Its slots may be supplied as additional
control = "missing"产生的数据使用的控制对象类"DataControl"。其插槽中可能会提供额外的
control = "DataControl" generate data as defined by the control
control = "DataControl"生成所定义的数据由控制
(作者)----------Author(s)----------
Andreas Alfons
参考文献----------References----------
Statistical Simulation: The R Package <code>simFrame</code>. Journal of Statistical Software, 37(3), 1–36. URL http://www.jstatsoft.org/v37/i03/.
参见----------See Also----------
"DataControl", "VirtualDataControl"
"DataControl","VirtualDataControl"
实例----------Examples----------
require(mvtnorm)
mean <- rep(0, 2)
sigma <- matrix(c(1, 0.5, 0.5, 1), 2, 2)
# using a control object[使用控制对象]
dc <- DataControl(size = 10, distribution = rmvnorm,
dots = list(mean = mean, sigma = sigma))
generate(dc)
# supply slots of control object as arguments[电源插槽的控制对象作为参数]
generate(size = 10, distribution = rmvnorm,
dots = list(mean = mean, sigma = sigma))
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|