Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这个问题与这里和这里的帖子密切相关。
假设随机变量 X = Gamma(k, theta),我对模拟 Y 感兴趣,其中 Y = log(X)。
您能否建议允许这样做的 R 包(或建议 R 代码)?非常感谢您!
如果您需要提取Y样本,只需尝试:
Y
#set the number of samples n<-10000 Y<-log(rgamma(n,k,theta))
然后,例如,您可以hist(Y)查看分布。
hist(Y)