Gol*_*ize 2 r distribution random-sample weibull
我是 R 新手,在使用 Weibull 分布函数时遇到问题。
我必须使用累积分布,所以我必须使用 pweibull 函数。我也知道形状必须在 0.7 到 0.8 之间。
pweibull(q, shape, scale = 1, lower.tail = T, log.p = F)
Run Code Online (Sandbox Code Playgroud)
现在是棘手的部分,对于 q 参数,我需要传递通过 Weibull 逆计算的随机值,该逆将具有 0 到 1 之间的随机值作为输入。这个功能好用吗?
pdiweibull(x, q, beta)
Run Code Online (Sandbox Code Playgroud)
总而言之,如果我创建一个包含 100 个随机数的向量,其值从 0 到 1,将其作为“x”参数传递给 pdiweibull,然后将该结果作为“q”参数传递给 pweibull,我是否将我的想法正确地转换为 R 代码?
如果您对 Weibull 分布感兴趣,则不应使用“离散逆 Weibull 分布”,这是完全不同的东西。
而只是使用四个威布尔分布函数
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)
Run Code Online (Sandbox Code Playgroud)
用于密度、分布函数、分位数函数和随机值。
rweibull(100, shape=0.75, scale=1)将给出一百个值,也许是你想要的形式,qweibull(runif(100), shape=0.75, scale=1)或者可能是像qweibull(x, shape=0.75, scale=1)where xis a vector of 100 random values between 0 and 1