Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

dist_weibull

The Weibull distribution


Description

[Stable]

Usage

dist_weibull(shape, scale)

Arguments

shape

shape and scale parameters, the latter defaulting to 1.

scale

shape and scale parameters, the latter defaulting to 1.

Details

Generalization of the gamma distribution. Often used in survival and time-to-event analyses.

We recommend reading this documentation on https://pkg.mitchelloharawild.com/distributional/, where the math will render nicely.

In the following, let X be a Weibull random variable with success probability p = p.

Support: R^+ and zero.

Mean: λ Γ(1+1/k), where Γ is the gamma function.

Variance: λ [ Γ (1 + \frac{2}{k} ) - (Γ(1+ \frac{1}{k}))^2 ]

Probability density function (p.d.f):

f(x) = \frac{k}{λ}(\frac{x}{λ})^{k-1}e^{-(x/λ)^k}, x ≥ 0

Cumulative distribution function (c.d.f):

F(x) = 1 - e^{-(x/λ)^k}, x ≥ 0

Moment generating function (m.g.f):

∑_{n=0}^∞ \frac{t^nλ^n}{n!} Γ(1+n/k), k ≥ 1

See Also

Examples

dist <- dist_weibull(shape = c(0.5, 1, 1.5, 5), scale = rep(1, 4))

dist
mean(dist)
variance(dist)
skewness(dist)
kurtosis(dist)

generate(dist, 10)

density(dist, 2)
density(dist, 2, log = TRUE)

cdf(dist, 4)

quantile(dist, 0.7)

distributional

Vectorised Probability Distributions

v0.2.2
GPL-3
Authors
Mitchell O'Hara-Wild [aut, cre] (<https://orcid.org/0000-0001-6729-7695>), Earo Wang [ctb] (<https://orcid.org/0000-0001-6448-5260>), Matthew Kay [ctb] (<https://orcid.org/0000-0001-9446-0419>), Alex Hayes [aut] (<https://orcid.org/0000-0002-4985-5160>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.