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

PowerDist

Power distribution


Description

Density, distribution function, quantile function and random generation for the power distribution.

Usage

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)

Arguments

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[X ≤ x] otherwise, P[X > x].

p

vector of probabilities.

n

number of observations. If length(n) > 1, the length is taken to be the number required.

Details

Probability density function

f(x) = (β*x^(β-1)) / (α^β)

Cumulative distribution function

F(x) = x^β / α^β

Quantile function

F^-1(p) = α * p^(1/β)

Examples

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)

extraDistr

Additional Univariate and Multivariate Distributions

v1.9.1
GPL-2
Authors
Tymoteusz Wolodzko
Initial release
2020-08-20

We don't support your browser anymore

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