R语言 计算Weibull密度值 – dweibull()函数
R语言中的 dweibull() 函数用于计算Weibull分布的不同数值的Weibull密度值。
语法: dweibull(x, shape)
参数:
x: 数值向量
shape: 形状参数
例1 :
# R Program to compute
# Weibull Density
# Creating a sequence of x-values
x <- seq(-10, 10, by = 1)
# Calling dweibull() Function
y <- dweibull(x, shape = 0.2)
y
输出
[1] 0.000000000 0.000000000 0.000000000 0.000000000 0.000000000 0.000000000
[7] 0.000000000 0.000000000 0.000000000 0.000000000 Inf 0.073575888
[13] 0.036419388 0.023895654 0.017633032 0.013888170 0.011403732 0.009638988
[19] 0.008323206 0.007305972 0.006497101
例2 :
# R Program to compute
# Weibull Density
# Creating a sequence of x-values
x <- seq(-10, 10, by = 0.5)
# Calling dweibull() Function
y <- dweibull(x, shape = 0.5)
# Plot a graph
plot(y)
输出:

极客教程