R语言 计算负二项式量化函数的值 – qnbinom()函数
R语言中的 qnbinom() 函数用于计算负二项式量化函数的值。它还可以创建一个负二项式量化函数的密度图。
语法: qnbinom(vec, size, prob)
参数:
vec: 二项式密度的X值
size: 试验的数量
prob:概率
例1 :
# R program to compute value of
# Negative Binomial Quantile Function
# Vector of x-values
x <- seq(0, 1, by = 0.1)
# Calling qnbinom() Function
y <- qnbinom(x, size = 100, prob = 0.5)
y
输出
[1] 0 82 88 92 96 99 103 107 112 118 Inf
例2 :
# R program to compute value of
# Negative Binomial Quantile Function
# Vector of x-values
x <- seq(0, 1, by = 0.01)
# Calling qnbinom() Function
y <- qnbinom(x, size = 100, prob = 0.8)
# Plot a graph
plot(y)
输出:

极客教程