我正在尝试对移动无线网络的阴影和快速衰落进行建模。对于快速衰落,瑞利衰落是一个合理的模型。信道响应的包络将是瑞利分布的。将该随机变量称为 R,其概率密度函数 (PDF) 为
PR(r) = ((2r)/Ω)*exp(-r^2/Ω), r >= 0, Ω = 2σ^2
http://en.wikipedia.org/wiki/Rayleigh_fading http://en.wikipedia.org/wiki/Rayleigh_fading看看方程写得很好。
所以,我有 PDF,现在我只是想知道如何从中获取随机变量?
我看过这些问题:
在 Ruby 中生成符合概率分布的数字数组? https://stackoverflow.com/questions/4550758/generate-array-of-numbers-that-fit-to-a-probability-distribution-in-ruby
生成具有概率分布的随机数 https://stackoverflow.com/questions/3109670/generate-random-numbers-with-probabilistic-distribution
但我仍然不知道该怎么做。我花了很长时间才理解 PDF,所以如果有人知道 Java 中获取特定 PDF 的随机变量的方法,我将不胜感激!
瑞利分布是一个特例威布尔分布 http://en.wikipedia.org/wiki/Weibull_distribution。如果你谷歌一下,就会发现有很多用 Java 编写的威布尔生成器,例如:
- http://commons.apache.org/math/apidocs/org/apache/commons/math3/distribution/WeibullDistribution.html http://commons.apache.org/math/apidocs/org/apache/commons/math3/distribution/WeibullDistribution.html
- http://www.iro.umontreal.ca/~simardr/ssj/doc/html/umontreal/iro/lecuyer/randvar/WeibullGen.html http://www.iro.umontreal.ca/~simardr/ssj/doc/html/umontreal/iro/lecuyer/randvar/WeibullGen.html
- http://www.icsa.inf.ed.ac.uk/research/groups/hase/simjava/distributions/doc/eduni/distributions/Weibull.html http://www.icsa.inf.ed.ac.uk/research/groups/hase/simjava/distributions/doc/eduni/distributions/Weibull.html
- http://www.ee.ucl.ac.uk/~mflanaga/java/PsRandom.html http://www.ee.ucl.ac.uk/~mflanaga/java/PsRandom.html
从给定分布生成随机数的一种方法是生成在 0 到 1 之间均匀分布的随机数,并应用目标分布的逆CDF http://en.wikipedia.org/wiki/Cumulative_distribution_function到那个随机数。看维基百科 http://en.wikipedia.org/wiki/Inverse_transform_sampling.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)