Learn R Programming

extraDistr (version 1.8.1)

NSBeta: Non-standard beta distribution

Description

Non-standard form of beta distribution with lower and upper bounds denoted as min and max. By default min=0 and max=1 what leads to standard beta distribution.

Usage

dnsbeta(x, shape1, shape2, min = 0, max = 1, log = FALSE)
pnsbeta(q, shape1, shape2, min = 0, max = 1, lower.tail = TRUE, log.p = FALSE)
qnsbeta(p, shape1, shape2, min = 0, max = 1, lower.tail = TRUE, log.p = FALSE)
rnsbeta(n, shape1, shape2, min = 0, max = 1)

Arguments

x, q
vector of quantiles.
shape1, shape2
non-negative parameters of the Beta distribution.
min, max
lower and upper bounds.
log, log.p
logical; if TRUE, probabilities p are given as log(p).
lower.tail
logical; if TRUE (default), probabilities are $P[X \leq 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.

See Also

Beta

Examples

Run this code

x <- rnsbeta(1e5, 5, 13, -4, 8)
xx <- seq(-20, 20, by = 0.1)
hist(x, 100, freq = FALSE)
lines(xx, dnsbeta(xx, 5, 13, -4, 8), col = "red") 
hist(pnsbeta(x, 5, 13, -4, 8))
plot(ecdf(x))
lines(xx, pnsbeta(xx, 5, 13, -4, 8), col = "red", lwd = 2)

Run the code above in your browser using DataLab