全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 R语言论坛
2181 3
2010-01-18
请教一下 r中有没有相当于randomize 用于产生不同种子的函数啊 谢谢啦
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2010-1-18 22:49:29
What do you mean by 种子?

If you want to generate data from normal distribution, try
rnorm(100) # generate 100 observations from standard normal distribution.

Similarly you may get data from t-distribution: rt(100,DF) # DF is degree of freedom.

To generate random number, try package random by Dirk Eddelbuettel and others given below:
Random Number Generators:

Basic functionality : R provides several random number generators (RNGs). The random seed can be provided via set.seed and the kind of RNG can be specified using RNGkind. The default RNG is the Mersenne-Twister algorithm. Other generators include Wichmann-Hill, Marsaglia-Multicarry, Super-Duper, Knuth-TAOCP, Knuth-TAOCP-2002, as well as user-supplied RNGs. For normal random numbers, the following algorithms are available: Kinderman-Ramage, Ahrens-Dieter, Box-Muller, Inversion (default). In addition to the tools above, setRNG provides an easy way to set, retain information about the setting, and reset the RNG.
Pseudo-randomness : RDieHarder offers several dozen new RNGs from the GNU GSL. randtoolbox provides more recent RNGs such as SF Mersenne-Twister and WELL, which are generators of Mersenne Twister type, but with improved quality parameters. rngwell19937 provides one of the WELL generators with 53 bit resolution of the output and allows seeding by a vector of integers of arbitrary length. randaes provides the deterministic part of the Fortuna cryptographic pseudorandom number generator (AES). SuppDists implements two RNGs of G. Marsaglia.
Support for several independent streams: rsprng implements Scalable Parallel RNGs library. rstream focuses on multiple independent streams of random numbers from different sources (in an object oriented approach).
For non-uniform generation, the Runuran package interfaces to the UNU.RAN library for universal non-uniform RNGs.
Misc.: rv package provides a class to easily manipulate and summarize simulations in R.
Quasi-randomness : The randtoolbox provides the following quasi random sequences: the Sobol sequence, the Halton (hence Van Der Corput) sequence and the Torus sequence (also known as Kronecker sequence). lhs package implements the latin hypercube sampling, an hybrid quasi/pseudo random method.
True randomness : The random package provides several functions that access the true random number service at random.org .
RNG tests : RDieHarder offers numerous tests of RNGs based on a reimplementation and extension of Marsaglia's DieHarder battery. randtoolbox provides basic RNG tests.
Parallel computing : For parallel computing with random numbers, see the HighPerformanceComputing task view.
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2010-1-19 00:05:18
是的 我是说种子 谢谢楼上
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2010-1-19 16:40:44
?set.seed
and so on
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群