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

R语言 rsprng包 init.sprng()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-9-28 22:15:19 | 显示全部楼层 |阅读模式
init.sprng(rsprng)
init.sprng()所属R语言包:rsprng

                                        Initialize SPRNG (Scalable Parallel Random Number Generator)
                                         公共初始化SPRNG(可扩展并行随机数发生器)

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

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

init.sprng initializes the parallel random number generator types and seeds.
init.sprng初始化的并行随机数生成器类型和种子。

RNGkind ("user") is called if necessary so that the default RNG is substituted with the parallel one.
RNGkind ("user")被称为如有必要,以便默认的RNG取代的平行。


用法----------Usage----------


init.sprng (nstream, streamno, seed = 0, kindprng = "default", para = 0)



参数----------Arguments----------

参数:nstream
total number of random number streams to be initialized
以进行初始化的随机数流的总数


参数:streamno
the rank of the the random number stream in current process (valid value is from 0 to nstream - 1)
排名的随机数流在当前进程(有效值是从0到nstream -  1)


参数:seed
an integer of random number seed.  It is not the starting state of the sequence; rather, it is an encoding of the starting state. The same seed for all the streams.  Distinct streams are returned.  Only the 31 least significant bits of seed are used in determining the initial starting state of the stream.  Default value is 0 where the default seed for each random number generator is used
的随机数种子的整数。它不是序列的起始状态,相反,它是一种编码的起始状态。同样的种子,为所有的流。返回不同的流。只有31个最显着位种子用于在确定流的最初的起始状态。缺省值是0,其中默认的每个随机数发生器的种子用于


参数:kindprng
a character string of the disired kind of parallel random number generator
一个字符串的disired一种并行随机数发生器


参数:para
additional parameters for the parallel random number generators.  If para is 0, default parameters for each PRNG are used.  When invalid parameter is given, a warning is issued and the default paramter is used.
并行随机数生成器的附加参数。如果para是0,默认参数为每个PRNG的使用。无效的参数时,发出警告,并且使用默认的参数是通过。


Details

详细信息----------Details----------

The currently available PRNG kinds are given below.  prngkind is partially matched to this list.  The default is "LFG".  <ol> "LFG"Modified Lagged Fibonacci Generator
当前可用的PRNG种在下面给出。 prngkind部分匹配到此列表中。默认的"LFG"。 <OL>"LFG"修改滞后的斐波那契数发生器

The recurrence relation for this sequence of random numbers is given by the following equation:
此随机数序列的递推关系由下面的等式给出:

where XOR is the exclusive-or operator, x and y are sequences obtained from Lagged Fibonacci sequences X and Y of the following form:
XOR是异或操作员,x和y是滞后斐波那契序列的序列X和Y以下形式:

<p align="center">Y_n = (Y_{n-k} + Y_{n-l}) \mathrm{ Mod } M
<p ALIGN="CENTER"> Y_n = (Y_{n-k} + Y_{n-l}) \mathrm{ Mod } M

l and k are called the lags of the generator, and we use the convention that l > k.  M is chosen to be 2^32. X_n and Y_n are 32 bit integers.  x is obtained from X by setting the Least Significant Bit of the latter to 0. y is obtained from Y by shifting the latter right by one bit. This modification of the Lagged Fibonacci Generator is performed in order to avoid certain correlations that are observed in the unmodified generator.
l和k被称为滞后的发电机,和我们使用的惯例,l > k。 M被选定为2^32。 X_n和Y_n是32位整数。 x得到从X通过后者的最低有效位设置为0。 y从Y通过移动后者右移1位获得。此修改滞后斐波纳契发生器进行,以避免一定的相关性,观察到在未修改发生器。

The period of this generator is 2^31(2^l-1) where l is the lag.  For the default generator with lag l = 1279, the period is approximately 2^1310. The number of distinct streams available is 2^{31(l-1)-1}.  For the default generator this gives 2^39648 distinct streams.
此发电机的时期是2^31(2^l-1)l的滞后。对于默认生成与滞后l = 1279,周期约为2^1310的。可用的不同数据流的数量是2^{31(l-1)-1}。对于默认生成这给2^39648不同的流。

The parameters to this generator are the values of the lags. Allowed para values are:
这种发生器的参数的滞后值。宠物para的值是:

</table>   
</ TABLE>

"LCG"48 Bit Linear Congruential Generator with Prime Addend
"LCG" 48位线性同余发生器首要加数

The recurrence relation for the sequence of random numbers produced by this generator is given by the following recurrence:      
由该发生器产生的随机数序列的递推关系由下式给出下面的复发:

The multiplier a is a parameter to this generator.  Allowed para values are 0 to 6, corresponding to 7 prefined multipliers.  
的乘数a这种发电机是一个参数。宠物para的值是0~6,对应于7个预先定义的乘法器。

"LCG64"64 Bit Linear Congruential Generator with Prime Addend
"LCG64"64位线性同余发生器的首要加数

The features of this generator are similar to the "LCG", except that the arithmetic is modulo 2^64.  The multipliers and prime addends p for this generator are different from those for the 48 bit generator.
该发电机的功能是类似的"LCG",不同的是,该算法是模2^64。乘法器和首要加数p这个生成器是不同的48位发生器。

The period of this generator is 2^64.  The number of distinct streams available is over 10^8.  Allowed para values are 0 to 2, corresponding to 3 prefine multipliers.  
这种发电机是2^64的时期。提供不同的流的数量超过10^8。宠物para的值是0~2,对应于3 prefine乘法器。

"CMRG"Combined Multiple Recursive Generator
"CMRG"组合多个递归发电机

This generator is defined by the following relation:      
此发生器由下列关系式定义:

where x_n is the sequence generated by the 64 bit Linear Congruential Generator and y_n is the sequence generated by the following prime modulus Multiple Recursive Generator:   
x_n是序列所产生的64位线性同余发生器和y_n是由以下主要模多个递归发电机产生的序列:

The same prime modulus generator is used for all the streams. Streams differ due to differences in the 64 bit LCG.  The period of this generator is around 2^219. The number of distinct streams available is over 10^8.
相同的质数模数发生器用于所有的流。流在64位LCG的不同而存在差异。这种发电机的周期大约是2^219。提供不同的流的数量超过10^8。

The multiplier a for the 64 bit LCG is a parameter to this generator.  Allowed para values are 0 to 2, corresponding to 3 prefine multipliers (same as "LCG64").  
的乘数a的64位LCG的这种发电机是一个参数。宠物para的值是0~2,对应至3 prefine乘法器(相同"LCG64")。

"MLFG"Multiplicative Lagged Fibonacci Generator
"MLFG"乘法滞后斐波那契数发生器

The recurrence relation for this sequence of random numbers is given by the following equation:      
此随机数序列的递推关系由下面的等式给出:

l and k are called the lags of the generator, and we use the convention that l > k.  M is chosen to be 2^64.
l和k被称为滞后的发电机,和我们使用的惯例,l > k。 M被选定为2^64。

The period of this generator is 2^61(2^l-1) where l is the lag.  For the default generator with lag l = 17, the period is approximately 2^81.  The number of distinct streams available is 2^{63(l-1)-1}.  For the default generator this gives around 2^1008 distinct streams.
此发电机的时期是2^61(2^l-1)l的滞后。对于默认生成与滞后l = 17,周期约为2^81的。可用的不同数据流的数量是2^{63(l-1)-1}。对于默认的发电机,这让周围2^1008不同的流。

The parameters to this generator are the values of the lags.  Allowed para values are:
这种发生器的参数的滞后值。宠物para的值是:

</table>   
</ TABLE>

"PMLCG"Prime Modulus Linear Congruential Generator
"PMLCG"质数模线性同余发生器

This generator is defined by the following relation:
此发生器由下列关系式定义:

x_n = ( a  x_{n-1} ) \mathrm{ Mod } 2^61-1
x_n = ( a  x_{n-1} ) \mathrm{ Mod } 2^61-1

where the multiplier a differs for each stream.  The mulitpler is chosen to be certain powers of 37 that give maximal period cycles of acceptable quality.
乘法器a为每个数据流不同。的mulitpler被选定为某些权力的37周期的可接受的质量提供了最大的时期。

The period of this generator is 2^61-2. The number of distinct streams available is roughly 2^58.
这种发电机是2^61-2的时期。可用的不同的流的数目大约是2^58。

This generator only accept the default parameter thus 0 is the only allowed value for para.  </ol>
该发电机只能接受这样的默认参数0是唯一的允许值para。 </ OL>


值----------Value----------

None.
无。


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

Only one active stream is allowed for each R process.  Multiple streams per process can be achieved by saving (packing) the states of the streams and unpacking when needed.
只有一个活动的流被允许的每个R过程。保存(包装)的状态流和拆包在需要的时候,可以实现多数据流的每个进程。


(作者)----------Author(s)----------



Na (Michael) Li <a href="mailto:nali@umn.edu">nali@umn.edu</a>




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

SPRNG: Scalable Parallel Random Number Generator Library Web Page. http://sprng.cs.fsu.edu/

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

free.sprng, pack.sprng, spawn.sprng, spawn.new.sprng
free.sprng,pack.sprng,spawn.sprng,spawn.new.sprng


实例----------Examples----------


init.sprng (1, 0, kind = "MLFG", para = 6)
runif (10)
free.sprng ()

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-11-27 21:48 , Processed in 0.026455 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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