11 random r gamma-distribution
为了从R中的反伽马分布进行采样,以下是正确的方法:
#I want to sample an inverse-gamma(a,b) a = 4 b = 9 x = 1/rgamma(1,a,b)
Pau*_*tra 6
虽然@Dason和@Stephane已经评论过你的方法是有效的,但R中有几个包可以做到这一点(发现谷歌搜索r inverse gamma:
r inverse gamma
另见维基百科页面的伽马分布和两个分布的概率密度函数的反伽马分布:
对于伽玛分布与:
对于反伽马.
归档时间:
12 年,2 月 前
查看次数:
11370 次
最近记录:
9 年 前