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

Weibull

Create a Weibull distribution


Description

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

Usage

Weibull(shape, scale)

Arguments

shape

The shape parameter k. Can be any positive real number.

scale

The scale parameter λ. Can be any positive real number.

Details

We recommend reading this documentation on https://alexpghayes.github.io/distributions3, where the math will render with additional detail and much greater clarity.

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

Value

A Weibull object.

See Also

Examples

set.seed(27)

X <- Weibull(0.3, 2)
X

random(X, 10)

pdf(X, 2)
log_pdf(X, 2)

cdf(X, 4)
quantile(X, 0.7)

distributions3

Probability Distributions as S3 Objects

v0.1.1
MIT + file LICENSE
Authors
Alex Hayes [aut, cre] (<https://orcid.org/0000-0002-4985-5160>), Ralph Moller-Trane [aut], Emil Hvitfeldt [ctb] (<https://orcid.org/0000-0002-0679-1945>), Daniel Jordan [ctb], Bruna Wundervald [ctb]
Initial release

We don't support your browser anymore

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