use R software
Let X be a non-negative random variable with μ = E[X] < ∞. For a random sample x1, …, xn from the distribution of X, the Gini ratio is defined by
G=12n2μn∑j=1n∑i=1|xi−xj|.G=12n2μ∑j=1n∑i=1n|xi−xj|.
The Gini ratio is applied in economics to measure inequality in income distribution (see, e.g., [168]). Note that G can be written in terms of the order statistics x(i) as
G=1n2μn∑i=1(2i−n−1)x(i).G=1n2μ∑i=1n(2i−n−1)x(i).
If the mean is unknown, let ˆGG^ be the statistic G with μ replaced by ¯xx¯. Estimate by simulation the mean, median and deciles of ˆGG^ if X is standard lognormal. Repeat the procedure for the uniform distribution and Bernoulli(0.1). Also construct density histograms of the replicates in each case.
This is the code using standard lognormal distribution. Mean and median in this case is 0.514 and 0.511
For unifrom distribution, rlnorm( n ) is replaced by runif( n ) and mean and median in this case is 0.331 and 0.330
For bernoulli distribution, rlnorm( n ) is replaced by rbinom( n, size = 1, prob = 0.1 ) and mean and median in this case is 0.899 and 0.9.
Get Answers For Free
Most questions answered within 1 hours.