BP: Reparameterized Beta Prime (BP) distribution for fitting a...

Description Usage Arguments Value Note Author(s) References Examples

View source: R/Codes.R

Description

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.

Usage

1
2
3
4
5
6
7
8
9
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)

Arguments

mu.link

object for which the extraction of model residuals is meaningful.

sigma.link

type of residual to be used.

x, q

vector of quantiles.

mu

vector of scale parameter values.

sigma

vector of shape parameter values.

log

logical; if TRUE, quantiles are given as log.

lower.tail

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

log.p

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

n

number of observations. If length(n) > 1, the length is taken to be the number required.

p

vector of probabilities.

Value

returns a gamlss.family object which can be used to fit a BP distribution in the gamlss() function.

Note

For the function BP(), mu is the mean and sigma is the precision parameter of the BP distribution.

Author(s)

Manoel Santos-Neto manoel.ferreira at professor.ufcg.edu.br

References

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. doi: 10.1007/s40300-021-00203-y

Examples

1
2
3
4
y <- rBP(n = 100)
hist(y)
plot(function(x) dBP(x), 0.0001, 8)
gamlss::gamlss(y ~ 1, family = BP)

BPmodel documentation built on Sept. 23, 2021, 9:07 a.m.