PowerDist | R Documentation |
Density, distribution function, quantile function and random generation for the power distribution.
dpower(x, alpha, beta, log = FALSE)
ppower(q, alpha, beta, lower.tail = TRUE, log.p = FALSE)
qpower(p, alpha, beta, lower.tail = TRUE, log.p = FALSE)
rpower(n, alpha, beta)
x , q |
vector of quantiles. |
alpha , beta |
parameters. |
log , log.p |
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are |
p |
vector of probabilities. |
n |
number of observations. If |
Probability density function
f(x) = \frac{\beta x^{\beta-1}}{\alpha^\beta}
Cumulative distribution function
F(x) = \frac{x^\beta}{\alpha^\beta}
Quantile function
F^{-1}(p) = \alpha p^{1/\beta}
x <- rpower(1e5, 5, 16)
hist(x, 100, freq = FALSE)
curve(dpower(x, 5, 16), 2, 6, col = "red", add = TRUE, n = 5000)
hist(ppower(x, 5, 16))
plot(ecdf(x))
curve(ppower(x, 5, 16), 2, 6, col = "red", lwd = 2, add = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.