Matlab中随机函数所采用的算法

来源:互联网 发布:凯迪网络 奥一网 编辑:程序博客网 时间:2024/06/05 09:18

Version 4.0 and earlier uses "minimum standard" LCG(线性同余法linear congruential) for rand() and a modified Box-Muller for randn()

 

Versions 5.0 and later uses 32 seed generator based on the lagged Fibonacci sequence for the rand() and the ziggurat method for randn()

 

(摘自PPT:《Random Random Number Generators》,Steve C. Thompson,sct@ucsd.edu)

 

标准C库函数rand()同样采用线性同余法,有些是16位,有些是31位。

原创粉丝点击