betanormUC: The Beta-Normal Distribution

Description Usage Arguments Details Value Author(s) References Examples

Description

Density, distribution function, quantile function and random generation for the univariate beta-normal distribution.

Usage

1
2
3
4
5
6
dbetanorm(x, shape1, shape2, mean = 0, sd = 1, log = FALSE)
pbetanorm(q, shape1, shape2, mean = 0, sd = 1,
          lower.tail = TRUE, log.p = FALSE)
qbetanorm(p, shape1, shape2, mean = 0, sd = 1,
          lower.tail = TRUE, log.p = FALSE)
rbetanorm(n, shape1, shape2, mean = 0, sd = 1)

Arguments

x, q

vector of quantiles.

p

vector of probabilities.

n

number of observations. Same as runif.

shape1, shape2

the two (positive) shape parameters of the standard beta distribution. They are called a and b respectively in beta.

mean, sd

the mean and standard deviation of the univariate normal distribution (Normal).

log, log.p

Logical. If TRUE then all probabilities p are given as log(p).

lower.tail

Logical. If TRUE then the upper tail is returned, i.e., one minus the usual answer.

Details

The function betauninormal, the VGAM family function for estimating the parameters, has not yet been written.

Value

dbetanorm gives the density, pbetanorm gives the distribution function, qbetanorm gives the quantile function, and rbetanorm generates random deviates.

Author(s)

T. W. Yee

References

Gupta, A. K. and Nadarajah, S. (2004). Handbook of Beta Distribution and Its Applications, pp.146–152. New York: Marcel Dekker.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## Not run: 
shape1 <- 0.1; shape2 <- 4; m <- 1
x <- seq(-10, 2, len = 501)
plot(x, dbetanorm(x, shape1, shape2, m = m), type = "l", ylim = 0:1, las = 1,
     ylab = paste("betanorm(",shape1,", ",shape2,", m=",m, ", sd=1)", sep = ""),
     main = "Blue is density, orange is cumulative distribution function",
     sub = "Gray lines are the 10,20,...,90 percentiles", col = "blue")
lines(x, pbetanorm(x, shape1, shape2, m = m), col = "orange")
abline(h = 0, col = "black")
probs <- seq(0.1, 0.9, by = 0.1)
Q <- qbetanorm(probs, shape1, shape2, m = m)
lines(Q, dbetanorm(Q, shape1, shape2, m = m), col = "gray50", lty = 2, type = "h")
lines(Q, pbetanorm(Q, shape1, shape2, m = m), col = "gray50", lty = 2, type = "h")
abline(h = probs, col = "gray50", lty = 2)
pbetanorm(Q, shape1, shape2, m = m) - probs  # Should be all 0

## End(Not run)

VGAM documentation built on Jan. 16, 2021, 5:21 p.m.