CompoundQuantiles | R Documentation |
Calculation of the quantiles of a compound GB2 random variable. Random generation of compound GB2 variables.
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)
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 |
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, |
ff |
numeric; a tuning parameter. |
debug |
logical; By default, |
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. |
qcgb2
returns a vector of quantiles and rcgb2
return a vector of size n
of GB2 compound random deviates.
Monique Graf and Desislava Nedyalkova
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.
#\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) #}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.