当前位置: 首页>>代码示例 >>用法及示例精选 >>正文


R语言 dweibull()用法及代码示例


dweibull()R语言中的函数用于计算威布尔分布的不同数值上的威布尔密度值。

用法: 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)

输出:

相关用法


注:本文由纯净天空筛选整理自nidhi_biet大神的英文原创作品 Compute the Value of Weibull Density in R Programming – dweibull() Function。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。