CompoundQuantiles: Quantiles and random generation of the Compound Distribution...

CompoundQuantilesR Documentation

Quantiles and random generation of the Compound Distribution based on the GB2

Description

Calculation of the quantiles of a compound GB2 random variable. Random generation of compound GB2 variables.

Usage

qcgb2(prob, shape1, scale, shape2, shape3, pl0, pl, decomp="r", tol=1e-08, ff=1.5, 
debug=FALSE, maxiter=50)
rcgb2(n, shape1, scale, shape2, shape3, pl0, pl, decomp="r", tol=1e-02, maxiter=100,
debug = FALSE)

Arguments

prob

numeric; vector of probabilities between 0 and 1.

shape1,scale,shape2,shape3

numeric; positive parameters of the GB2 distribution.

n

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

pl0

numeric; a vector of initial proportions defining the number of components and the weight of each component density in the decomposition. Sums to one.

pl

numeric; a vector of mixture probabilities. Sums to one. If pl=pl0 we obtain the GB2 distribution.

decomp

string; specifying if the decomposition of the GB2 is done with respect to the right tail ("r") or the left tail ("l") of the distribution. By default, decomp = "r" - right tail decomposition.

ff

numeric; a tuning parameter.

debug

logical; By default, debug = FALSE.

maxiter

numeric; maximum number of iterations to perform.

tol

numeric; tolerance with default 0, meaning to iterate until additional terms do not change the partial sum.

Value

qcgb2 returns a vector of quantiles and rcgb2 return a vector of size n of GB2 compound random deviates.

Author(s)

Monique Graf and Desislava Nedyalkova

References

Graf, M., Nedyalkova, D., Muennich, R., Seger, J. and Zins, S. (2011) AMELI Deliverable 2.1: Parametric Estimation of Income Distributions and Indicators of Poverty and Social Exclusion. Technical report, AMELI-Project.

Examples

#\dontrun{

#\library{cubature}

# GB2 parameters
af <- 5
bf <- 20000
pf <- 0.45 
qf <- 0.75

p0 <- rep(1/3,3)
p1 <- c(0.37,0.43,0.2)

#Quantiles

qcgb2(0.5,af,bf,pf,qf,p0,p1)
qcgb2(1,af,bf,pf,qf,p0,p1)
qcgb2(c(0.5,0.8),af,bf,pf,qf,p0,p1)

#Random generation
rcgb2(10,af,bf,pf,qf,p0,p1)

#}

GB2 documentation built on June 22, 2022, 9:07 a.m.

Related to CompoundQuantiles in GB2...