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.
我知道数学,但是如何计算R中泊松和负二项分布下的预期零数?有什么功能可以这样做吗?
你说你知道数学,在这种情况下你已经知道你正在计算np(0),对吧?
你已经知道n。
那么,您的问题不是“我如何评估R 中的泊松或负二项式的p(0) = P(X=0)吗?”
尝试
?Poisson
和
?NegBinomial
你会看到dpois泊松有一个函数,负二项式也有一个类似的函数。
dpois
因此n*dpois(0,lambda)(使用您需要的任何值代替lambda)将给出给定泊松分布的预期零数。负二项式计算的工作原理类似。
n*dpois(0,lambda)
lambda