WARING: Waring distribution for fitting a GAMLSS model

WARINGR Documentation

Waring distribution for fitting a GAMLSS model

Description

The function WARING() defines the Waring distribution, a two parameter distribution, for a gamlss.family object to be used in GAMLSS fitting using the function gamlss(), with mean equal to the parameter mu and scale parameter sigma. The functions dWARING, pWARING, qWARING and rWARING define the density, distribution function, quantile function and random generation for the WARING parameterization of the Waring distribution.

Usage

WARING(mu.link = "log", sigma.link = "log")
dWARING(x, mu = 2, sigma = 2, log = FALSE)
pWARING(q, mu = 2, sigma = 2, lower.tail = TRUE, log.p = FALSE) 
qWARING(p, mu = 2, sigma = 2, lower.tail = TRUE, log.p = FALSE, 
    max.value = 10000)
rWARING(n, mu = 2, sigma = 2)

Arguments

mu.link

Defines the mu.link, with "log" link as the default for the mu parameter

sigma.link

Defines the sigma.link, with "log" link as the default for the sigma parameter

x

vector of (non-negative integer) quantiles.

q

vector of quantiles.

p

vector of probabilities.

n

number of random values to return.

mu

vector of positive mu values.

sigma

vector of positive sigma values.

lower.tail

logical; if TRUE (default) probabilities are P[Y\leq y], otherwise, P[Y>y].

log, log.p

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

max.value

constant; generates a sequence of values for the cdf function.

Details

The Waring distribution, WARING, has density,

f(y|\mu, \sigma)= \frac{B(y+\mu \sigma^{-1}, \sigma^{-1}+2)}{B(\mu \sigma^{-1}, \sigma^{-1}+1)}

for y=0,1,2,\ldots, \mu>0 and \sigma>0 see pp. 490-492 of Rigby et al. (2019).

Value

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

Author(s)

Fiona McElduff, Bob Rigby and Mikis Stasinopoulos. f.mcelduff@ich.ucl.ac.uk

References

Wimmer, G. and Altmann, G. (1999) Thesaurus of univariate discrete probability distributions. Stamm.

Rigby, R. A., Stasinopoulos, D. M., Heller, G. Z., and De Bastiani, F. (2019) Distributions for modeling location, scale, and shape: Using GAMLSS in R, Chapman and Hall/CRC, \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1201/9780429298547")}. An older version can be found in https://www.gamlss.com/.

Stasinopoulos D. M., Rigby R.A., Heller G., Voudouris V., and De Bastiani F., (2017) Flexible Regression and Smoothing: Using GAMLSS in R, Chapman and Hall/CRC. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1201/b21973")}

(see also https://www.gamlss.com/).

See Also

gamlss.family

Examples

par(mfrow=c(2,2))
y<-seq(0,20,1)
plot(y, dWARING(y), type="h")
q <- seq(0, 20, 1)
plot(q, pWARING(q), type="h")
p<-seq(0.0001,0.999,0.05)
plot(p , qWARING(p), type="s")
dat <- rWARING(100)
hist(dat)
#summary(gamlss(dat~1, family=WARING))

gamlss.dist documentation built on Aug. 24, 2023, 1:06 a.m.