找回密码
 注册
查看: 267|回复: 0

R语言 rstream包 rstream-class()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-9-28 22:24:32 | 显示全部楼层 |阅读模式
rstream-class(rstream)
rstream-class()所属R语言包:rstream

                                        Class "rstream" – Multiple streams of uniform random numbers
                                         类“rstream”的 - 多数据流均匀分布的随机数

                                         译者:生物统计家园网 机器人LoveR

描述----------Description----------

The virtual class "rstream" provides a unified interface to uniform random number generators. Objects of its subclasses act as a source of streams for random numbers that can be handled by a set of methods and which can be used as arguments of functions that require sources of randomness, e.g. discrete event models, Monte Carlo integration or other stochastic simulations.
虚拟类“rstream”的提供统一的接口均匀分布的随机数生成器。它的子类的对象作为一个源的数据流的随机数,可以通过以下来处理的一组方法,它可以用来作为参数的函数,需要来源的随机性,例如离散事件模型,蒙特卡罗积分或其他随机模拟。

The instances of objects of this class and its subclasses are independent, i.e., sampling random numbers from one instance or reseting and changing its state does not effect any other instance. (However, different streams may not be stochastically  independent if they are not carefully seeded!)
这个类及其子类的实例对象是独立的,即采样随机数的一个实例或下重启,将其状态更改不会影响任何其他实例。 (但是,不同的流可能不随机独立,如果他们不仔细接种!)

Additionally there is a mechanismus interface to save and restore such streams, e.g. for the next R session, for a reruning some stochastic calculations with identical input, or for sending the stream object to a slave node in parallel computing via MPI.
此外,还有是一个mechanismus的界面来保存和恢复如流,例如在未来的R会话中,一个reruning一些随机的计算具有相同的输入,或通过MPI的并行计算从节点发送的流对象。

The interface to these classes is inspired by Pierre L'Ecuyers RngStreams package.
皮埃尔的LEcuyers RngStreams包的灵感来自于这些类的接口。


类对象----------Objects from the Class----------

A virtual Class: No objects may be created from it.
可能会从它创建一个虚拟类:没有对象。


方法----------Methods----------

The virtual class "rstream" prepares the following methods for handling random stream 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”准备下列方法来处理随机流对象。参数返回的流对象的一些方法,有一个变种,使用<-改变相应的参数。相应的方法的详细信息,请参阅手册页。

<STRONG>Notice:</STRONG> Some subclasses only implement a subset of these interfaces. The methods that do not work produce an error message.
<STRONG>注意:</ STRONG>的一些子类中实现这些接口的一个子集。不工作的方法产生一个错误信息。

Methods to use the stream (available for all subclasses):
使用流(适用于所有的子类)的方法:




rstream.sample signature(object = "rstream"):
rstream.samplesignature(object = "rstream"):




r signature(object = "rstream"):
Rsignature(object = "rstream"):




rstream.reset signature(object = "rstream"):
rstream.resetsignature(object = "rstream"):

Some subclasses have implemented the concept of substreams. This is especially usefull if two or more streams should be synchronized:
已实施的一些子类的子流的概念。这是特别有用的,如果两个或两个以上的数据流应该是同步的:




rstream.nextsubstream signature(object = "rstream"):
rstream.nextsubstreamsignature(object = "rstream"):




rstream.resetsubstream signature(object = "rstream"):
rstream.resetsubstreamsignature(object = "rstream"):

Antithetic random streams return numbers which have smallest possible correlation (i.e. -1) to their respective counterparts:
对偶随机流返回有最小的可能的相关性(即-1)他们各自的对应的数字:




rstream.antithetic signature(object = "rstream"): Whether or not the stream object returns antithetic random
rstream.antithetic signature(object = "rstream"):是否返回的流对象对偶随机




rstream.antithetic<- signature(object = "rstream"):
rstream.antithetic < - signature(object = "rstream"):

Most sources of pseudo random numbers generate random numbers of precision 2^(-32) ~ 2.e-10. For some streams this can be increased to machine epsilon (i.e. ~ 1.e-16) by combining two random numbers of lower precision:
大多数来源伪随机数生成的随机数的精度2^(-32) ~ 2.e-10。对于某些数据流,这可以提高到机器ε(即~ 1.e-16)由结合的精度较低的两个随机数:




rstream.incprecision signature(object = "rstream"): Whether or not the stream object returns random numbers with
rstream.incprecisionsignature(object = "rstream"):不管是不是流对象返回随机数




rstream.incprecision<- signature(object = "rstream"):
rstream.incprecision < - signature(object = "rstream"):

Handling "rstream" objects:
处理“rstream”对象:




print signature(x = "rstream"):
打印signature(x = "rstream"):




show signature(x = "rstream"):
显示signature(x = "rstream"):




rstream.name signature(object = "rstream"):
rstream.namesignature(object = "rstream"):




rstream.name<- signature(object = "rstream"):
rstream.name < - signature(object = "rstream"):




rstream.clone signature(object = "rstream"):
rstream.clonesignature(object = "rstream"):

When a "rstream" 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的”对象应使用在另一个R会话或保存为某种重用的对象必须装的所有信息。请注意,没有其他方法比拆包可以应用到压缩对象。它之前必须先解压缩。




rstream.packed signature(object = "rstream"):
rstream.packedsignature(object = "rstream"):




rstream.packed<- signature(object = "rstream"):
rstream.packed < - “signature(object = "rstream"):


警告----------Warning ----------

When "rstream" objects should be used in later R sessions they must be packed before the current R session is stopped and unpacked after the new R session has been started and the workspace image has been reloaded.
当“rstream”对象应使用在以后的R会话中,他们必须装在当前的R会话停止并解压缩后,新的R会话已经开始,并在工作区的形象已经重载。


注意----------Note----------

"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“。

The actual interface is implemented in subclasses, one for each source (package/library) of random numbers. The slots of this class and of all its subclasses must not be accessed directly. Use the above methods instead.
在子类中,为每个源(包/库)的随机数的实际接口的实现。不能直接访问这个类和它的所有子类的插槽。用上面的方法。

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>



参考文献----------References----------

An object-oriented random-number package with many long streams and substreams. Operations Research 50(6), 1073-1075.

参见----------See Also----------

rstream.mrg32k3a, rstream.runif. rstream.antithetic-methods, rstream.clone-methods, rstream.incprecision-methods, rstream.name-methods, rstream.packed-methods, rstream.reset-methods, rstream.sample-methods, rstream.nextsubstream-methods, rstream.RNG.
rstream.mrg32k3a,rstream.runif。 rstream.antithetic-methods,rstream.clone-methods,rstream.incprecision-methods,rstream.name-methods,rstream.packed-methods,rstream.reset-methods,rstream.sample-methods,rstream.nextsubstream-methods,rstream.RNG。

转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。


注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2024-11-27 20:24 , Processed in 0.030360 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表