The function BP() defines the BP distribution, a two
parameter distribution, for a gamlss.family object to be used in GAMLSS
fitting using using the function gamlss(), with mean equal to the
parameter mu and sigma equal the precision parameter. The
functions dBP, pBP, qBP and rBP define the density
, distribution function, quantile function and random generation for the
BP parameterization of the BP distribution.
BP(mu.link = "log", sigma.link = "log")dBP(x, mu = 1, sigma = 1, log = FALSE)
pBP(q, mu = 1, sigma = 1, lower.tail = TRUE, log.p = FALSE)
rBP(n = 1, mu = 1, sigma = 1)
qBP(p, mu = 1, sigma = 1, lower.tail = TRUE, log.p = FALSE)
object for which the extraction of model residuals is meaningful.
type of residual to be used.
vector of quantiles.
vector of scale parameter values.
vector of shape parameter values.
logical; if TRUE, quantiles are given as log.
logical; if TRUE (default), probabilities are P[X <= x], otherwise, P[X > x].
log.p logical; if TRUE, probabilities p are given as log(p).
number of observations. If length(n) > 1, the length is taken
to be the number required.
vector of probabilities.
returns a gamlss.family object which can be used to fit a BP
distribution in the gamlss() function.
Rigby, R.A., Stasinopoulos, D.M., Heller, G.Z., and De Bastiani, F. Distributions for modeling location, scale, and shape: Using GAMLSS in R, London: Chapman and Hall/CRC, 2019.
Stasinopoulos D.M., Rigby R.A., Heller G., Voudouris V., and De Bastiani F. Flexible Regression and Smoothing: Using GAMLSS in R, London: Chapman and Hall/CRC, 2017
Bourguignon, M., Santos-Neto, M. and Castro, M. A new regression model for positive random variables with skewed and long tail. METRON, v. 79, p. 33--55, 2021. http://dx.doi.org/10.1007/s40300-021-00203-y
# NOT RUN {
y <- rBP(n = 100)
hist(y)
plot(function(x) dBP(x), 0.0001, 8)
gamlss::gamlss(y ~ 1, family = BP)
# }
Run the code above in your browser using DataLab