由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Statistics版 - 求教: simulation of a complex distribution
相关主题
请问R里面哪个MCMC(或者metropolis-hastings)的package里的proposal density可以用户定义的请教:用C怎么产生uniform的随机数
一般如何证明MCMC算法得到的sample是来自targeted distribution的呢?面试题请教?
求问一下MCMC和一般的蒙特卡洛法有什么区别?Metropolis Hastings vs. Gibbs sampler。
MCMC不converge怎么办?付费找tutor
[求教]文献里的一句话,关于MCMC的一个关于MCMC 的问题
请问Markov Chain Monte Carlo和 Monte Carlo根本性的区别是什么?我有几个学位,背景很强,找个intern怎么那么难?
问两个简单的sample的问题how to determine data fit some distribution? thanks
[Need Help] Hierarchical model and MCMC :)1/X(X是正态分布)的分布问题
相关话题的讨论汇总
话题: normalized话题: accept话题: simulation话题: complex
进入Statistics版参与讨论
1 (共1页)
z*****h
发帖数: 17
1
f(x) is proptional to
exp{-sum(v_i*(x-b_i))-(x-c)^2/(2s)}/product{1+exp(b_i-x)}
i=1 to 20, v_i, b_i, c, s 已知。sum表示和,product表示积。
请问有什莫方法可以模拟这种复杂的分布?可以用ratio of uniforms吗?
多谢您的任何帮助!!!
f***a
发帖数: 329
2
可以先试试accept-reject algorithm吧

【在 z*****h 的大作中提到】
: f(x) is proptional to
: exp{-sum(v_i*(x-b_i))-(x-c)^2/(2s)}/product{1+exp(b_i-x)}
: i=1 to 20, v_i, b_i, c, s 已知。sum表示和,product表示积。
: 请问有什莫方法可以模拟这种复杂的分布?可以用ratio of uniforms吗?
: 多谢您的任何帮助!!!

z*****h
发帖数: 17
3
多谢!是不是可以把它看作两部分:Normal+其他. 其他小于1。只要generate Normal
and Uniform? Thank tremendous!!!
z*****h
发帖数: 17
4
Sorry. I think the problem is that the function is not normalized and it is
impossible to calculate the normalization constant. Can I still use accept-
reject? Any help will be high appreciated,
h***i
发帖数: 3844
5
why need normalized?

is

【在 z*****h 的大作中提到】
: Sorry. I think the problem is that the function is not normalized and it is
: impossible to calculate the normalization constant. Can I still use accept-
: reject? Any help will be high appreciated,

z*****h
发帖数: 17
6
I'm using the algorithm for accept-reject:
1. generate X~g, U~U(0,1)
2. Accept Y=X if U<=f(X)/Mg(X)
3. Return to 1, otherwise
Here f(x) <=Mg(x) for some constant M>=1. My understanding is f(x) and g(x)
are both normalized density functions. If they are not normalized, can I
still use this algorithm?
Thanks a lot for your help,
h***i
发帖数: 3844
7
找个和f(X) 定义域一样的分布做g,然后找个M,让f(X)/Mg(X) 永远小于1
f(x) and g(x)are both normalized density functions 这条不需要,反正有M,怕什么

)

【在 z*****h 的大作中提到】
: I'm using the algorithm for accept-reject:
: 1. generate X~g, U~U(0,1)
: 2. Accept Y=X if U<=f(X)/Mg(X)
: 3. Return to 1, otherwise
: Here f(x) <=Mg(x) for some constant M>=1. My understanding is f(x) and g(x)
: are both normalized density functions. If they are not normalized, can I
: still use this algorithm?
: Thanks a lot for your help,

s*r
发帖数: 2757
8
inverse the CDF
z*****h
发帖数: 17
9
If f(x) need not to be normalized, can I use the following algorithm?
1. Generate X~N(c,s), U~U(0,1)
2. Accept Y=X if U<=1(or sqrt(2pi*s)?)
3. Return to 1, otherwise
I'm confused about how to determine M. If f(x) is density function, there
will be no confusion. But here f(x) is proptional to ...
Any help will be highly appreciated,
t****r
发帖数: 702
10
You can use Metropolis-Hasting algorithm b/c the rejection sampling method c
an be very inefficient.
It seems to me that your density function is log-concave, but not sure, you'
d better check it your self. If it is log-concave, a more efficient way of g
enerating random numbers would be Adaptive rejection sampling (google it).
Hope that helps.

【在 z*****h 的大作中提到】
: If f(x) need not to be normalized, can I use the following algorithm?
: 1. Generate X~N(c,s), U~U(0,1)
: 2. Accept Y=X if U<=1(or sqrt(2pi*s)?)
: 3. Return to 1, otherwise
: I'm confused about how to determine M. If f(x) is density function, there
: will be no confusion. But here f(x) is proptional to ...
: Any help will be highly appreciated,

相关主题
请问Markov Chain Monte Carlo和 Monte Carlo根本性的区别是什么?请教:用C怎么产生uniform的随机数
问两个简单的sample的问题面试题请教?
[Need Help] Hierarchical model and MCMC :)Metropolis Hastings vs. Gibbs sampler。
进入Statistics版参与讨论
z*****h
发帖数: 17
11
Thanks a lot. I'll check the adptive rejection sampling. Thank you!!!
z*****h
发帖数: 17
12
Google了一下ARS and AMRS。发现R里有现成的function。有人用过吗?谢谢!
h***i
发帖数: 3844
13
真强,都到这一步了why不花时间自己figure out?

【在 z*****h 的大作中提到】
: Google了一下ARS and AMRS。发现R里有现成的function。有人用过吗?谢谢!
n****6
发帖数: 570
14
Gilks has a c source code for arms, it seems very stable. You can google it.
I know some people using it for MCMC sampling. Actually, if you only sample
one parameter, maybe numerical integration is very efficient.
z*****h
发帖数: 17
15
是Gibbs Sampling其中一个parameter。平时工作用SAS,C和R用的很少。见笑了。谢谢
大家的帮助!!!会再check一下doing sampling using numerical integration. 谢
谢!!!
h***i
发帖数: 3844
16
SAS 也可以做

【在 z*****h 的大作中提到】
: 是Gibbs Sampling其中一个parameter。平时工作用SAS,C和R用的很少。见笑了。谢谢
: 大家的帮助!!!会再check一下doing sampling using numerical integration. 谢
: 谢!!!

1 (共1页)
进入Statistics版参与讨论
相关主题
1/X(X是正态分布)的分布问题[求教]文献里的一句话,关于MCMC的
想学data mining和machine learning 请问哪些课比较重要?请问Markov Chain Monte Carlo和 Monte Carlo根本性的区别是什么?
MCMC sampling with mixture of Gaussian问两个简单的sample的问题
关于一个MCMC 的概念[Need Help] Hierarchical model and MCMC :)
请问R里面哪个MCMC(或者metropolis-hastings)的package里的proposal density可以用户定义的请教:用C怎么产生uniform的随机数
一般如何证明MCMC算法得到的sample是来自targeted distribution的呢?面试题请教?
求问一下MCMC和一般的蒙特卡洛法有什么区别?Metropolis Hastings vs. Gibbs sampler。
MCMC不converge怎么办?付费找tutor
相关话题的讨论汇总
话题: normalized话题: accept话题: simulation话题: complex