betalu: The General Support Beta Distribution

Description Usage Arguments Details Author(s) Examples

Description

Density, distribution function, quantile function and random generation for the general support beta distribution.

Usage

1
2
3
4
5
6
7
dbetalu(x, shape1, shape2, l = 0, u = 1, ncp = 0, log = FALSE)

pbetalu(q, shape1, shape2, l = 0, u = 1, ncp = 0, lower.tail = TRUE)

qbetalu(p, shape1, shape2, l = 0, u = 1, ncp = 0)

rbetalu(n, shape1, shape2, l = 0, u = 1, ncp = 0)

Arguments

x, q

vector of quantiles.

shape1

beta parameter shape1

shape2

beta parameter shape2

l

lower bound of support

u

upper bound of support

ncp

non-centrality parameter.

log

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

The general support beta distribution with parameters shape1, shape2, l, and u is the distribution of the random variable Y = (u-l)*X + l where X ~ Beta(shape1, shape2). For details on that distribution, see dbeta.

Author(s)

David Kahle david.kahle@gmail.com

Examples

1
2
3
4
5
6
7
8
9
s <- seq(-1, 1, .01)
plot(s, dbetalu(s, 5, 5, -1, 1), type = "l")

f <- function(x) dbetalu(x, 5, 5, -1, 1)
x <- -0.5
integrate(f, -1, x)
(p <- pbetalu(x, 5, 5, -1, 1))
qbetalu(p, 5, 5, -1, 1)
mean(rbetalu(1e6, 5, 5, -1, 1) <= -.5) # ~= p

dkahle/betalu documentation built on May 15, 2019, 9:07 a.m.