rstream.runif-class(rstream)
rstream.runif-class()所属R语言包:rstream
Class "rstream.runif" – Interface to R internal uniform random
“rstream.runif类” - R内部均匀分布的随机接口
译者:生物统计家园网 机器人LoveR
描述----------Description----------
This class implements the "rstream" interface for the R internal uniform RNGs. This class allows to access and handle these generators in exactly the same way as external generators. In particular, one can create copies of generators. There is no need to deal with RNGkind and set.seed when different RNGs should be used.
这类实现了的“rstream”的R内部统一的随机数据生成器的接口。这个类允许访问和处理这些发电机中完全相同的方式作为外部发生器。特别地,一个可以创建副本的发生器。有没有必要处理RNGkind和set.seed时,应使用不同的随机数据生成器。
类对象----------Objects from the Class----------
Objects can be created by calls of the form new("rstream.runif", name, kind, seed, antithetic).
可以创建对象通过调用的形式new("rstream.runif", name, kind, seed, antithetic)。
name: An arbitrary string to name the stream object. If omitted a string that consists of runif and some number (which is increased every time when a new rstream
名称:任意字符串命名的流对象。如果一个字符串组成的runif和一些数字(这是增加每次当一个新的rstream的省略
kind: A character string. The new "rstream" object uses the RNG of type kind. The same strings as for RNGkind can be used. Additionally the string "current" is available to use the type of generator to which R is currently set (this is the default if no kind is given).
种类:一个字符串。的的新“rstream”对象使用的RNG类型kind。可以使用相同的字符串为RNGkind。此外,该字符串"current"是使用类型的发电机,其中R是当前设置(这是默认情况下,如果没有一种)。
seed: The seed for the generator as used by the
种子:种子的发电机所用的
antithetic: A boolean. Whether or not antithetic random numbers should be produced.
对立的:一个布尔值。无论是或不是对立的随机数产生。
扩展----------Extends----------
Class "rstream", directly.
类"rstream",直接。
方法----------Methods----------
The class "rstream.runif" provides the following methods for handling "rstream.runif" objects. Some methods that return parameters of the stream object have a variant that uses <- to change the respective parameters. See the man pages for the respective methods for details.
类“rstream.runif”提供了以下方法用于处理“rstream.runif”的对象。参数返回的流对象的一些方法,有一个变种,使用<-改变相应的参数。相应的方法的详细信息,请参阅手册页。
Methods to use the stream:
使用流的方法:
rstream.sample signature(object = "rstream.runif"):
rstream.samplesignature(object = "rstream.runif"):
r signature(object = "rstream.runif"):
Rsignature(object = "rstream.runif"):
rstream.reset signature(object = "rstream.runif"):
rstream.resetsignature(object = "rstream.runif"):
Antithetic random streams:
对偶随机流:
rstream.antithetic signature(object = "rstream.runif"): Whether or not the stream object returns antithetic random
rstream.antithetic signature(object = "rstream.runif"):是否返回的流对象对偶随机
rstream.antithetic<- signature(object = "rstream.runif"):
rstream.antithetic < - signature(object = "rstream.runif"):
Handling "rstream.runif" objects:
处理“rstream.runif”对象:
print signature(x = "rstream.runif"):
打印signature(x = "rstream.runif"):
rstream.name signature(object = "rstream.runif"):
rstream.namesignature(object = "rstream.runif"):
rstream.name<- signature(object = "rstream.runif"):
rstream.name < - signature(object = "rstream.runif"):
rstream.clone signature(object = "rstream.runif"):
rstream.clonesignature(object = "rstream.runif"):
initialize signature(.Object = "rstream.runif"):
初始化signature(.Object = "rstream.runif"):
When a "rstream.runif" object should be used in another R session or saved for some kind of later reuse all information about the object must be packed. Notice no method other than unpacking can be applied to a packed object. It must be unpacked before.
当“rstream.runif”对象应使用在另一个R会话或保存为某种重用的对象必须装的所有信息。请注意,没有其他方法比拆包可以应用到压缩对象。它之前必须先解压缩。
rstream.packed signature(object = "rstream.runif"):
rstream.packedsignature(object = "rstream.runif"):
rstream.packed<- signature(object = "rstream.runif"):
rstream.packed < - “signature(object = "rstream.runif"):
注意----------Note----------
The slots of this class must not be accessed directly. Use the above methods instead.
不能直接访问这个类的插槽。用上面的方法。
"rstream" objects cannot simply be copied by <-. The new variable does not hold a copy of an "rstream" object but just points to the old object which might not be the wanted result (similar to R environments). Use rstream.clone instead.
不能简单地复制<-“rstream”的对象。新的变量不持有一个的“rstream”的对象的副本,但只是点到老的对象,这可能不是所希望的结果(类似的R环境)。使用rstream.clone“。
One may miss a method for reseeding a random stream. However, there is no need for such a method as there is a method for resetting the stream to its initial state. I one needs a stream with a different stream, then a new rstream object should be created at all.
有人可能会错过补种一个随机的数据流的方法。然而,也没有必要为这样的方法,有一种方法用于复位到其初始状态的流。我需要用不同的流流,然后一个新的rstream对象应在所有创建。
Packed objects must be unpacked before any other method can be applied.
可应用于任何其他方法之前,必须先解压缩盒装对象。
(作者)----------Author(s)----------
Josef Leydold <a href="mailto:josef.leydold@wu.ac.at">josef.leydold@wu.ac.at</a>
参见----------See Also----------
rstream, rstream.antithetic-methods, rstream.clone-methods, rstream.name-methods, rstream.packed-methods, rstream.reset-methods, rstream.sample-methods, rstream.RNG.
rstream,rstream.antithetic-methods,rstream.clone-methods,rstream.name-methods,rstream.packed-methods,rstream.reset-methods,rstream.sample-methods,rstream.RNG。
实例----------Examples----------
## create a new rstream.runif object[#创建一个新的rstream.runif对象]
s <- new("rstream.runif")
## show state of this object[#显示该对象的状态]
print(s)
## show and change name of stream object[#显示和更改名称的流对象]
rstream.name(s)
rstream.name(s) <- "mystream"
## get a random number[#得到一个随机数]
x <- rstream.sample(s)
## get a random sample of size 100[#得到一个随机样本大小为100]
x <- rstream.sample(s,100)
## reset random stream[#重置随机流]
rstream.reset(s)
## show and set antithetic flag[#显示和设置对立的标志]
rstream.antithetic(s)
rstream.antithetic(s) <- TRUE
## make a clone of the rstream object[的rstream对象的克隆]
sc <- rstream.clone(s)
## pack and unpack the rstream object[#包装和解压的rstream的的对象]
rstream.packed(s) <- TRUE
rstream.packed(s) <- FALSE
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|