Learn R Programming

BCSreg (version 1.1.1)

BCS: The Box-Cox Symmetric Distributions

Description

Density function, distribution function, quantile function, and random generation for the class of the Box-Cox symmetric (BCS) distributions.

Usage

dBCS(x, mu, sigma, lambda, zeta, family = "NO", log = FALSE)

pBCS( q, mu, sigma, lambda, zeta, family = "NO", lower.tail = TRUE, log.p = FALSE )

qBCS( p, mu, sigma, lambda, zeta, family = "NO", lower.tail = TRUE, log.p = FALSE )

rBCS(n, mu, sigma, lambda, zeta, family = "NO")

Value

dBCS returns the density function, pBCS gives the cumulative distribution function, qBCS provides the quantile function, and rBCS generates random variables.

Arguments

x, q

vector of positive quantiles.

mu

vector of strictly positive scale parameters.

sigma

vector of strictly positive relative dispersion parameters.

lambda

vector of real-valued skewness parameters. If lambda = 0, the BCS distribution reduces to the corresponding log-symmetric distribution with parameters mu and sigma (and a possible extra parameter zeta).

zeta

strictly positive extra parameter. It must be specified with only one value in cases where the BCS distribution has an extra parameter. See “Details” below.

family

a character that specifies the symmetric generating family of the BCS distribution. Available options are: "NO" (default), "ST", "LOI", "LOII", "PE", "SN", "HP", and "SL", corresponding to the normal, Student-t, type I logistic, type II logistic, power exponential, sinh-normal, hyperbolic, and slash distributions, respectively.

log, log.p

logical; if TRUE, probabilities p are given as log(p). Default is FALSE.

lower.tail

logical; if TRUE (default), probabilities are \(P(X \le x)\) otherwise, \(P(X > x)\).

p

vector of probabilities.

n

number of observations. If `n` is a vector, its length is used as the number of required observations.

Author

Francisco F. de Queiroz <felipeq@ime.usp.br>

Rodrigo M. R. de Medeiros <rodrigo.matheus@ufrn.br>

Details

The class of the BCS distributions was introduced by Ferrari and Fumes (2017). It consists of a broad class of probability models for positive continuous data, which includes flexible distributions with different levels of skewness and tail-heaviness.

The BCS class includes, as special cases, the Box-Cox t (Rigby and Stasinopoulos, 2006), Box-Cox normal (or Box-Cox Cole-Green; Cole and Green, 1992), Box-Cox power exponential (Rigby and Stasinopoulos, 2004) distributions, as well as the log-symmetric distributions (Vanegas and Paula, 2016).

Let \(Y\) be a positive continuous random variable with a BCS distribution with parameters \(\mu > 0\), \(\sigma > 0\), and \(\lambda \in \mathbb{R}\) and density generating function \(r\). The probability density function of \(Y\) is given by

\( f(y; \mu, \sigma, \lambda) = \left\{\begin{array}{ll} \dfrac{y^{\lambda-1}}{\mu^\lambda \sigma} \dfrac{r(z^2)}{R\left(\frac{1}{\sigma |\lambda|}\right)}, & \mbox{ if } \lambda \neq 0,\\ \dfrac{1}{y\sigma} r(z^2), & \mbox{ if } \lambda = 0, \end{array}\right., \quad y > 0, \)

where \( z = \left\{ \begin{array}{ll} \dfrac{1}{\sigma \lambda} \left\{\left(\frac{y}{\mu}\right)^\lambda - 1 \right\}, & \mbox{ if } \lambda \neq 0, \\ \dfrac{1}{\sigma} \log\left(\frac{y}{\mu}\right), & \mbox{ if } \lambda = 0, \end{array} \right. \)

\(r:[0,\infty) \longrightarrow [0, \infty)\) satisfies \(\int_0^\infty u^{-1/2}r(u)\textrm{d} u = 1\), and \(R(x) = \int_{-\infty}^x r(u^2)\textrm{d} u, x \in \mathbb{R}\).

The function \(r\) is called density generating function, and it specifies the generating symmetric family of \(Y\) within the class of the BCS probability models. This function can also depend on extra parameters, such as the Box-Cox t and Box-Cox power exponential distributions. We call these extra parameters zeta. The currently available BCS distributions in the BCSreg package are listed below:

DistributionFamily abbreviationN. of extra parameters
Box-Cox Hyperbolic"HP"1
Box-Cox Type I Logistic"LOI"0
Box-Cox Type II Logistic"LOII"0
Box-Cox Normal"NO"0
Box-Cox Power Exponential"PE"1
Box-Cox Sinh-Normal"SN"1
Box-Cox Slash"SL"1
Box-Cox t"ST"1

References

Cole, T., and Green, P.J. (1992). Smoothing reference centile curves: the LMS method and penalized likelihood. Statistics in medicine, 11, 1305-1319.

Ferrari, S. L., and Fumes, G. (2017). Box-Cox symmetric distributions and applications to nutritional data. AStA Advances in Statistical Analysis, 101, 321-344.

Medeiros, R. M. R., and Queiroz, F. F. (2025). Flexible modeling of nonnegative continuous data: Box-Cox symmetric regression and its zero-adjusted extension.

Rigby, R. A., and Stasinopoulos, D. M. (2004). Smooth centile curves for skew and kurtotic data modelled using the Box-Cox power exponential distribution. Statistics in medicine, 23, 3053-3076.

Rigby, R. A., and Stasinopoulos, D. M. (2006). Using the Box-Cox t distribution in GAMLSS to model skewness and kurtosis. Statistical Modelling, 6, 209-229.

Vanegas, L. H., and Paula, G. A. (2016). Log-symmetric distributions: statistical properties and parameter estimation. Brazilian Journal of Probability and Statistics, 30, 196-220.

See Also

ZABCS to access the density function, distribution function, quantile function, and a random number generator for the zero-adjusted BCS distributions. BCSreg for estimating the parameters of a BCS regression model.

Examples

Run this code
# Probability density function

## Right-skewed distributions
curve(dBCS(x, 3, 0.3, -1.5, family = "NO"), xlim = c(0, 7), ylim = c(0, 0.7), ylab = "Density")
curve(dBCS(x, 3, 0.3, -1.5, 4, family = "ST"), add = TRUE, col = 2)
curve(dBCS(x, 3, 0.3, -1.5, 5, family = "PE"), add = TRUE, col = 4)
legend("topright", legend = c("BCNO", "BCT", "BCPE"), lty = 1, col = c(1, 2, 4))

## Truncated symmetric distributions (with support on (0, Inf))
curve(dBCS(x, 3, 0.3, 1, family = "NO"), xlim = c(0, 7), ylim = c(0, 0.7), ylab = "Density")
curve(dBCS(x, 3, 0.3, 1, 4, family = "ST"), add = TRUE, col = 2)
curve(dBCS(x, 3, 0.3, 1, 5, family = "PE"), add = TRUE, col = 4)
legend("topright", legend = c("BCNO", "BCT", "BCPE"), lty = 1, col = c(1, 2, 4))

## Left-skewed distributions
curve(dBCS(x, 3, 0.3, 3, family = "NO"), xlim = c(0, 7), ylim = c(0, 0.7), ylab = "Density")
curve(dBCS(x, 3, 0.3, 3, 4, family = "ST"), add = TRUE, col = 2)
curve(dBCS(x, 3, 0.3, 3, 5, family = "PE"), add = TRUE, col = 4)
legend("topright", legend = c("BCNO", "BCT", "BCPE"), lty = 1, col = c(1, 2, 4))

# Random generation

## Parameter setting
mu <- 5        # scale parameter
sigma <- 0.2   # relative dispersion parameter
lambda <- -0.2 # skewness parameter

## Generating family
family <- "NO"

## Visualization
x <- rBCS(10000, mu, sigma, lambda, family = family)

hist(x, prob = TRUE, col = "white", main = "")
curve(dBCS(x, mu, sigma, lambda, family = family), col = "blue", add = TRUE)

plot(ecdf(x), main = "")
curve(pBCS(x, mu, sigma, lambda, family = family), col = "blue", add = TRUE)

Run the code above in your browser using DataLab