EVOLUTION-MANAGER
Edit File: Weibull.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: The Weibull Distribution</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for Weibull {stats}"><tr><td>Weibull {stats}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>The Weibull Distribution</h2> <h3>Description</h3> <p>Density, distribution function, quantile function and random generation for the Weibull distribution with parameters <code>shape</code> and <code>scale</code>. </p> <h3>Usage</h3> <pre> 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) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x, q</code></td> <td> <p>vector of quantiles.</p> </td></tr> <tr valign="top"><td><code>p</code></td> <td> <p>vector of probabilities.</p> </td></tr> <tr valign="top"><td><code>n</code></td> <td> <p>number of observations. If <code>length(n) > 1</code>, the length is taken to be the number required.</p> </td></tr> <tr valign="top"><td><code>shape, scale</code></td> <td> <p>shape and scale parameters, the latter defaulting to 1.</p> </td></tr> <tr valign="top"><td><code>log, log.p</code></td> <td> <p>logical; if TRUE, probabilities p are given as log(p).</p> </td></tr> <tr valign="top"><td><code>lower.tail</code></td> <td> <p>logical; if TRUE (default), probabilities are <i>P[X ≤ x]</i>, otherwise, <i>P[X > x]</i>.</p> </td></tr> </table> <h3>Details</h3> <p>The Weibull distribution with <code>shape</code> parameter <i>a</i> and <code>scale</code> parameter <i>b</i> has density given by </p> <p style="text-align: center;"><i>f(x) = (a/b) (x/b)^(a-1) exp(- (x/b)^a)</i></p> <p> for <i>x > 0</i>. The cumulative distribution function is <i>F(x) = 1 - exp(- (x/b)^a)</i> on <i>x > 0</i>, the mean is <i>E(X) = b Γ(1 + 1/a)</i>, and the <i>Var(X) = b^2 * (Γ(1 + 2/a) - (Γ(1 + 1/a))^2)</i>. </p> <h3>Value</h3> <p><code>dweibull</code> gives the density, <code>pweibull</code> gives the distribution function, <code>qweibull</code> gives the quantile function, and <code>rweibull</code> generates random deviates. </p> <p>Invalid arguments will result in return value <code>NaN</code>, with a warning. </p> <p>The length of the result is determined by <code>n</code> for <code>rweibull</code>, and is the maximum of the lengths of the numerical arguments for the other functions. </p> <p>The numerical arguments other than <code>n</code> are recycled to the length of the result. Only the first elements of the logical arguments are used. </p> <h3>Note</h3> <p>The cumulative hazard <i>H(t) = - log(1 - F(t))</i> is </p> <pre>-pweibull(t, a, b, lower = FALSE, log = TRUE) </pre> <p>which is just <i>H(t) = (t/b)^a</i>. </p> <h3>Source</h3> <p><code>[dpq]weibull</code> are calculated directly from the definitions. <code>rweibull</code> uses inversion. </p> <h3>References</h3> <p>Johnson, N. L., Kotz, S. and Balakrishnan, N. (1995) <em>Continuous Univariate Distributions</em>, volume 1, chapter 21. Wiley, New York. </p> <h3>See Also</h3> <p><a href="Distributions.html">Distributions</a> for other standard distributions, including the <a href="Exponential.html">Exponential</a> which is a special case of the Weibull distribution. </p> <h3>Examples</h3> <pre> x <- c(0, rlnorm(50)) all.equal(dweibull(x, shape = 1), dexp(x)) all.equal(pweibull(x, shape = 1, scale = pi), pexp(x, rate = 1/pi)) ## Cumulative hazard H(): all.equal(pweibull(x, 2.5, pi, lower.tail = FALSE, log.p = TRUE), -(x/pi)^2.5, tolerance = 1e-15) all.equal(qweibull(x/11, shape = 1, scale = pi), qexp(x/11, rate = 1/pi)) </pre> <hr /><div style="text-align: center;">[Package <em>stats</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>