韦布尔分布,即韦伯分布(Weibull distribution),又称韦氏分布或威布尔分布,是可靠性分析和寿命检验的理论基础。威布尔分布在可靠性工程中被广泛应用,尤其适用于机电类产品的磨损累计失效的分布形式。由于它可以利用概率值很容易地推断出它的分布参数,被广泛应用于各种寿命试验的数据处理。
The Weibull Distribution
Description
Density, distribution function, quantile function and random generation for the Weibull distribution with parameters shape
and scale
.
Usage
dweibull(x, shape, scale = 1, log = FALSE) pweibull(q, shape, scale = 1, lower.tail = TRUE, log.p = FALSE) qweibull(p, shape, scale = 1, lower.tail = TRUE, log.p = FALSE) rweibull(n, shape, scale = 1)
Arguments
x, q | vector of quantiles. |
p | vector of probabilities. |
n | number of observations. If |
shape, scale | shape and scale parameters, the latter defaulting to 1. |
log, log.p | logical; if TRUE, probabilities p are given as log(p). |
lower.tail | logical; if TRUE (default), probabilities are P[X ≤ x], otherwise, P[X > x]. |
#### 韦布尔(Weibull)分布
# 1.韦布尔分布中抽样函数rweibull
# shape :k, k >0是形状参数(shape parameter)
n <- 100
rweibull(n, shape=0.5)# 2.韦布尔分布概率密度函数
x <- seq(0,1,0.01)
y <- dweibull(x, shape=5)
plot(x,y)# 3.韦布尔分布累积概率
# P[X ≤ x]
pweibull(0.8,shape=5)
# P[X > x]
pweibull(0.8,shape=5,lower.tail = FALSE)# probabilities p are given as log(p).
pweibull(0.8,shape=5,log.p = TRUE)# 4.分位数函数qweibull(pweibull的反函数)
# 累积概率为0.95时的x值
# x <- seq(0,2,0.05)
# plot(x,pweibull(x, shape=5))
qweibull(0.95,shape=5)
qweibull(0.995,shape=5)