# weisd: The Weibull (Shape-Decay) Distribution In lcmix: Layered and chained mixture models

## Description

Density, distribution function, quantile function, random generation, expected value, variance, median, and raw moments for the shape-decay parameterization of the Weibull distribution.

## Usage

 ```1 2 3 4 5 6 7 8``` ```dweisd(x, shape, decay, log=FALSE) pweisd(q, shape, decay, lower.tail=TRUE, log.p=FALSE) qweisd(p, shape, decay, lower.tail=TRUE, log.p=FALSE) rweisd(n, shape, decay) eweisd(shape, decay) vweisd(shape, decay) medweisd(shape, decay) rmomweisd(r, shape, decay) ```

## Arguments

 `x,q` vector of quantiles. `p` vector of probabilities. `n` number of observations. If `length(n) > 1`, the length is taken to be the number required. `shape, decay` shape and decay parameters. See Details. `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]. `r` the `r`th raw moment is returned. See Value.

## Details

The `weisd` distribution with `shape` parameter s and `decay` parameter d has density

f(x) = s*d*x^(s-1) * exp(-d*x^s)

for x >= 0; s, d > 0. Compared to the usual shape-scale parameterization used in `dweibull` etc., with `shape` parameter a and `scale` parameter b, the relationship between the parameters is given by a = s and b = d^(-1/s), or equivalently, s = a and d = b^(-a).

## Value

`dweisd` gives the density, `pweisd` gives the distribution function, `qweisd` gives the quantile function, and `rweisd` generates random deviates. `eweisd` gives the expected value, `vweisd` gives the variance, and `medweisd` gives the median for the specified parameters. `rmomweisd` gives the `r`th raw moment for the specified parameters; for example, `rmomweisd(1, 2, 3)` is equivalent to `eweisd(2, 3)`.

## Note

The distribution function, using the parameters given in Details, has the very simple form

F(x) = 1 - exp(-d*x^s)

from which other functions such as the hazard function are easily derived.

## Author(s)

Daniel Dvorkin

`mvweisd` for the multivariate version; `thetahat` for parameter estimation; `Weibull` in package `stats`.