weibull function

The Weibull distribution

The Weibull distribution

Raw moments for the Weibull distribution.

mweibull(r = 0, truncation = 0, shape = 2, scale = 1, lower.tail = TRUE)

Arguments

  • r: rth raw moment of the distribution, defaults to 1.
  • truncation: lower truncation parameter, defaults to 0.
  • shape, scale: shape and scale of the distribution with default values of 2 and 1 respectively.
  • lower.tail: logical; if TRUE (default), moments are E[xrXy]E[x^r|X \le y], otherwise, E[xrX>y]E[x^r|X > y]

Returns

returns the truncated rth raw moment of the distribution.

Details

Probability and Cumulative Distribution Function:

f(x)=shapescale(ωscale)shape1e(ωscale)shape,FX(x)=1e(ωscale)shape f(x) = \frac{shape}{scale}(\frac{\omega}{scale})^{shape-1}e^{-(\frac{\omega}{scale})^shape} , \qquad F_X(x) = 1-e^{-(\frac{\omega}{scale})^shape}

The y-bounded r-th raw moment of the distribution equals:

μyr=scalerΓ(rshape+1,(yscale)shape) \mu^r_y = scale^{r} \Gamma(\frac{r}{shape} +1, (\frac{y}{scale})^shape )

where Γ(,)\Gamma(,) denotes the upper incomplete gamma function.

Examples

## The zeroth truncated moment is equivalent to the probability function pweibull(2, shape = 2, scale = 1) mweibull(truncation = 2) ## The (truncated) first moment is equivalent to the mean of a (truncated) random sample, #for large enough samples. x <- rweibull(1e5, shape = 2, scale = 1) mean(x) mweibull(r = 1, lower.tail = FALSE) sum(x[x > quantile(x, 0.1)]) / length(x) mweibull(r = 1, truncation = quantile(x, 0.1), lower.tail = FALSE)
  • Maintainer: Ruben Dewitte
  • License: GPL-3
  • Last published: 2020-05-25

Useful links