【问题标题】:Box Muller Transform is leaning to the rightBox Muller Transform 向右倾斜
【发布时间】:2021-01-11 09:42:59
【问题描述】:

我正在构建虚假信息传播的计算模拟 (Netlogo)。 首先,我想按照基本的高斯分布来分配人口的政治偏好(稍后我可以根据自己的喜好调整分布)。 我知道 Box Muller 变换是最简单的方法。 但是,在实施时,我发现情节always has a tendency to lean to the right。 有人知道这是为什么以及如何防止它吗? 另外,y2 gives a very different plot than y1。在查看 Box Muller 的示例时,它们都显示了两个具有相似高斯分布的图。有人也知道我的代码没有发生这种情况的原因吗? 我使用了以下代码:

let u1 random-float 1
let u2 random-float 1
let z1 sqrt (-2 * ln u1) * cos (2 * pi * u2)
let z2 sqrt (-2 * ln u1) * sin (2 * pi * u2)
report z1

random-float 1 表示它将选择一个介于 0 和 1 之间的浮点数。 提前致谢!

【问题讨论】:

    标签: netlogo distribution gaussian normal-distribution probability-distribution


    【解决方案1】:

    NetLogo 使用度数表示角度,我认为这种形式适用于弧度。但是,如果您只想从正态分布中提取,这一切都不必要地复杂,有一个 random-normal 函数

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2023-03-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-12-15
      • 1970-01-01
      相关资源
      最近更新 更多