bcca: The Box-Cox Cauchy Distribution

View source: R/01_bcca.R

bccaR Documentation

The Box-Cox Cauchy Distribution

Description

Density, distribution function, quantile function, and random generation for the Box-Cox Cauchy distribution with parameters mu, sigma, and lambda.

Usage

dbcca(x, mu, sigma, lambda, log = FALSE, ...)

pbcca(q, mu, sigma, lambda, lower.tail = TRUE, ...)

qbcca(p, mu, sigma, lambda, lower.tail = TRUE, ...)

rbcca(n, mu, sigma, lambda)

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 Box-Cox Cauchy distribution reduces to the log-Cauchy distribution with parameters mu and sigma (see lca).

log

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

...

further arguments.

lower.tail

logical; if TRUE (default), probabilities are P[X <= x], otherwise, P[X > x].

p

vector of probabilities.

n

number of random values to return.

Value

dbcca returns the density, pbcca gives the distribution function, qbcca gives the quantile function, and rbcca generates random observations.

Invalid arguments will result in return value NaN, with a warning.

The length of the result is determined by n for rbcca, and is the maximum of the lengths of the numerical arguments for the other functions.

Author(s)

Rodrigo M. R. de Medeiros <rodrigo.matheus@live.com>

References

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

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.

Examples

mu <- 10
sigma <- 0.5
lambda <- 4

# Sample generation
x <- rbcca(10000, mu, sigma, lambda)

# Density
hist(x, prob = TRUE, main = "The Box-Cox Cauchy Distribution", col = "white")
curve(dbcca(x, mu, sigma, lambda), add = TRUE, col = 2, lwd = 2)
legend("topright", "Probability density function", col = 2, lwd = 2, lty = 1)

# Distribution function
plot(ecdf(x), main = "The Box-Cox Cauchy Distribution", ylab = "Distribution function")
curve(pbcca(x, mu, sigma, lambda), add = TRUE, col = 2, lwd = 2)
legend("bottomright", c("Emp. distribution function", "Theo. distribution function"),
  col = c(1, 2), lwd = 2, lty = c(1, 1)
)

# Quantile function
plot(seq(0.01, 0.99, 0.001), quantile(x, seq(0.01, 0.99, 0.001)),
  type = "l",
  xlab = "p", ylab = "Quantile function", main = "The Box-Cox Cauchy Distribution"
)
curve(qbcca(x, mu, sigma, lambda), add = TRUE, col = 2, lwd = 2, from = 0, to = 1)
legend("topleft", c("Emp. quantile function", "Theo. quantile function"),
  col = c(1, 2), lwd = 2, lty = c(1, 1)
)

rdmatheus/BCNSM documentation built on Feb. 8, 2024, 1:28 a.m.