蒙特卡罗方法中的重要性抽样(以C为单位)
你好,我编写了一个代码,它使用“原始”蒙特卡罗采样技术成功地近似了一维、二维和三维积分。 我现在想通过使用“重要性采样”来改进这一点,因为显然这可以减少方差。我读过一些关于此的网页,但似乎没有一个特别清楚。我将如何实现这样的事情?非常感谢。杰克
Hiya, Ive written a code which successfully approximation one, two and three dimensional integrals using a 'crude' Monte-Carlo sampling technique.
I would now like to improve this by using 'importance sampling', as apparently this can reduce variance. I have read a few web pages about this but none seem particularly clear. How would I implement something like this? Many Thanks. Jack
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
没错,我发现了我的错误。我没有使用 PDF 的反积分来计算每个点的“权重”。对于任何感兴趣的人,我的条件循环如下所示:
其中 PDF 是我的概率密度函数,inverse 是 PDF 的逆积分。和average和average2分别代表和。
Right, I found my mistake. I wasn't using the inverse integral of the PDF to calculate the 'weight' of each point. For anyone whos's interested my conditional loop read like:
Where PDF is my probability density function, inverse is the inverse integral of the PDF. and average and average2 represent and respectively.