在 R 编程中计算泊松分位数函数的值 – qpois()函数
R 语言中的qpois()
函数用于计算 Poisson Quantile 函数的值。它为泊松分布创建了一个分位数密度图。
Syntax: qpois(vec, lambda)
Parameters:
vec: Sequence of integer values
lambda: Average number of events per interval
示例 1:
# R program to compute
# Poisson Quantile Density
# Sequence of x-values
x <- seq(0, 1, by = .01)
# Calling qpois() Function
y <- qpois(x, lambda = 5)
y
输出:
[1] 0 1 1 1 1 2 2 2 2 2 2 2 2 3 3 3 3 3
[19] 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4
[37] 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5
[55] 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6
[73] 6 6 6 6 6 7 7 7 7 7 7 7 7 7 7 8 8 8
[91] 8 8 8 8 9 9 9 10 10 11 Inf
示例 2:
# R program to compute
# Poisson Quantile Density
# Sequence of x-values
x <- seq(0, 1, by = 0.01)
# Calling qpois() Function
y <- qpois(x, lambda = 15)
# Plot a graph
plot(y)
输出: