Data-Fitting Function for the Rotated and Right-Shifted Lorenz Curve
Data-Fitting Function for the Rotated and Right-Shifted Lorenz Curve
fitLorenz is used to estimate the parameters of the rotated and right-shifted Lorenz curve using version 4 or 5 of MPerformanceE, or the Lorenz equations including SarabiaE, SCSE, and SHE.
UTF-8
expr: version 4 or 5 of MPerformanceE, or the Lorenz equations including SarabiaE, SCSE, and SHE.
z: the observations of size distribution (i.e., the household income distribution, the leaf size distribution).
ini.val: the initial values of the model parameters.
simpver: an optional argument to use version 4 or 5 of MPerformanceE.
control: the list of control parameters for using the optim function in package stats.
par.list: the option of showing the list of parameters on the screen.
fig.opt: an optional argument to draw the original and rotated Lorenz curves.
np: the number of data points to draw the predicted original and rotated Lorenz curves.
xlab: the label of the x-axis when showing the original Lorenz curve.
ylab: the label of the y-axis when showing the original Lorenz curve.
main: the main title of the figure.
subdivisions: please see the arguments for the integrate function in package stats.
rel.tol: please see the arguments for the integrate function in package stats.
abs.tol: please see the arguments for the integrate function in package stats.
stop.on.error: please see the arguments for the integrate function in package stats.
keep.xy: please see the arguments for the integrate function in package stats.
aux: please see the arguments for the integrate function in package stats.
par.limit: an optional argument to limit the numerical ranges of model parameters of the three Lorenz equations including SarabiaE, SCSE, and SHE.
Details
Here, ini.val only includes the initial values of the model parameters as a list. The Nelder-Mead algorithm (Nelder and Mead, 1965) is used to carry out the optimization of minimizing the residual sum of squares (RSS) between the observed and predicted y values. The optim
function in package stats was used to carry out the Nelder-Mead algorithm. Here, versions 4 and 5 of MPerformanceE and the Lorenz equations including SarabiaE, SCSE, and SHE can be used to fit the rotated and right-shifted Lorenz curve.
When simpver = 4, the simplified version 4 of MPerformanceE is selected:
There are three elements in P, representing the values of c, K1, and K2, respectively.
For the Lorenz functions, the user can define any formulae that follow the below form: Lorenz.fun <- function(P, x){...}, where P is the vector of parameter(s), x is the preditor that ranges between 0 and 1 representing the cumulative proportion of the number of individuals in a statistical unit, and Lorenz.fun is the name of a Lorenz function defined by the user, which also ranges between 0 and 1 representing the cumulative proportion of the income or size in a statistical unit. This package provides three representative Lorenz functions: SarabiaE, SCSE, and SHE.
Here, the Gini coefficient (GC) is calculated as follows when MPerformanceE
is selected:
\mboxGC=2∫02ydx,
where x and y are the independent and dependent variables in version 4 or 5 of MPerformanceE, respectively.
However, the Gini coefficient (GC) is calculated as follows when a Lorenz function, e.g., SCSE, is selected:
\mboxGC=2∫01ydx,
where x and y are the independent and dependent variables in the Lorenz function, respectively.
For SarabiaE and SHE, there are explicit formulae for GC (Sarabia, 1997; Sitthiyot and Holasut, 2023).
Returns
x1: the cumulative proportion of the number of an entity of interest, i.e., the number of households of a city, the number of leaves of a plant.
y1: the cumulative proportion of the size of an entity of interest.
x: the x coordinates of the rotated and right-shifted y1 versus x1.
y: the y coordinates of the rotated and right-shifted y1 versus x1.
par: the estimates of the model parameters.
r.sq: the coefficient of determination between the observed and predicted y values.
RSS: the residual sum of squares between the observed and predicted y values.
sample.size: the number of data points used in the data fitting.
GC: the calculated Gini coefficient.
Note
When MPerformanceE is selected, the estimates of the model parameters denote those in MPerformanceE rather than being obtained by directly fitting the y1 versus x1 data; when a Lorenz function is selected, the estimates of the model parameters denote those in the Lorenz function.
Huey, R.B., Stevenson, R.D. (1979) Integrating thermal physiology and ecology of ectotherms: a discussion of approaches. American Zoologist 19, 357−366. tools:::Rd_expr_doi("10.1093/icb/19.1.357")
Lian, M., Shi, P., Zhang, L., Yao, W., Gielis, J., Niklas, K.J. (2023) A generalized performance equation and its application in measuring the Gini index of leaf size inequality. Trees − Structure and Function 37, 1555−1565. tools:::Rd_expr_doi("10.1007/s00468-023-02448-8")
Lorenz, M.O. (1905) Methods of measuring the concentration of wealth. Journal of the American Statistical Association 9(70), 209−219. tools:::Rd_expr_doi("10.2307/2276207")
Nelder, J.A., Mead, R. (1965) A simplex method for function minimization. Computer Journal 7, 308−313. tools:::Rd_expr_doi("10.1093/comjnl/7.4.308")
Sarabia, J.-M. (1997) A hierarchy of Lorenz curves based on the generalized Tukey's lambda distribution. Econometric Reviews 16, 305−320. tools:::Rd_expr_doi("10.1080/07474939708800389")
Shi, P., Gielis, J., Quinn, B.K., Niklas, K.J., Ratkowsky, D.A., Schrader, J., Ruan, H., Wang, L., Niinemets, Ü. (2022) 'biogeom': An R package for simulating and fitting natural shapes. Annals of the New York Academy of Sciences 1516, 123−134. tools:::Rd_expr_doi("10.1111/nyas.14862")
Sitthiyot, T., Holasut, K. (2023) A universal model for the Lorenz curve with novel applications for datasets containing zeros and/or exhibiting extreme inequality. Scientific Reports