Changelog
Source:NEWS.md
wbpip 0.1.3
main changes
Key values: removed as individual arguments, instead supplied as one list using argument
key_values
created usinggd_lq_key_values
Remove unnecessary
dd
argument fromgd_compute_mld_*
andgd_compute_watts_*
This is potentially too much information, but here it is. The function
check_curve_validity_lq()
is called inDEV
in the following ways. It is used a) line 115 in gd_compute_dist_stats.R ingd_estimate_dist_stats_lq()
, where the r argument is squared as the input; b) line 784 in gd_compute_pip_stats_lq.R ingd_estimate_lq()
where the r argument is not squared; c) in line 137 of gd_compute_poverty_stats.R in functiongd_estimate_poverty_stats_lq()
where the r argument is not squared; d) line 103 of prod_gd_compute_pip_stats_lq().R in functionprod_gd_estimate_lq()
where the r argument is not squared. Therefore, out of the four times it is called it is only the first where the r argument is squared. The paper (Villasenor & Arnold, 1989) uses the square root for ther
argument, similar (although with a denominator) tor
calculated ingd_lq_key_values
. However, the other three calls ofcheck_curve_validity_lq()
mentioned above do not calculate the square root for r prior to the function call , which is why they just use ther
argument directly. What has been done here is to i) use the square root forr
inkey_values
list; ii) but then square ther
argument withincheck_curve_validity_lq()
. However,r
is never actually used anywhere incheck_curve_validity_lq()
except inif(r 0) {return(...)}
as an early check. This requires a bit more investigation to see whether ther
argument is necessary here.collapse - use functions directly, and use
max()
andsum()
rather thanfmax()
andfsum()
because base functions are more efficient.quantile functions in
md_compute_quantiles.R
that are efficient, utilizelorenz
argument, and wrap aroundmd_compute_lorenz()
Improvements in efficiency are made to
gd_compute_mld_lq()
andgd_compute_quantile_lq()
. However, there are no changes in relation to the bug fixes yet.Removed the functions in md_quantile_functions.R. First ensured that a corresponding function that served the same purpose could be found in md_compute_quantiles.R
increase efficiency in md_compute_polarization and correct the tests. The benchmarks in the tests were slightly off (at around the fourth decimal). When using the formula to calculate the benchmarks analytically, the tests pass.
wbpip 0.1.1
- Add new functions to compute the following indicators:
- Number of poor
- Average shortfall
- Total shortfall
- Income gap ratio
- Palma ratio
- Top 10 / Bottom 10 ratio
wbpip 0.0.4
Enhancements
- Make local file path more robust in test-suite
- Fix non-monotonicity bugs for grouped distributions
- Remove
purrr
dependency - add test for
sd_create_synth_vector
- create a separate function (
weighted_average_poverty_stats
) for repetitive calculation in adjust poverty stats and add corresponding test case for it.