Key values: removed as individual arguments, instead supplied as one list using argument key_values
created using gd_lq_key_values
Remove unnecessary dd
argument from gd_compute_mld_*
and gd_compute_watts_*
This is potentially too much information, but here it is. The function check_curve_validity_lq()
is called in DEV
in the following ways. It is used a) line 115 in gd_compute_dist_stats.R in gd_estimate_dist_stats_lq()
, where the r argument is squared as the input; b) line 784 in gd_compute_pip_stats_lq.R in gd_estimate_lq()
where the r argument is not squared; c) in line 137 of gd_compute_poverty_stats.R in function gd_estimate_poverty_stats_lq()
where the r argument is not squared; d) line 103 of prod_gd_compute_pip_stats_lq().R in function prod_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 the r
argument, similar (although with a denominator) to r
calculated in gd_lq_key_values
. However, the other three calls of check_curve_validity_lq()
mentioned above do not calculate the square root for r prior to the function call , which is why they just use the r
argument directly. What has been done here is to i) use the square root for r
in key_values
list; ii) but then square the r
argument within check_curve_validity_lq()
. However, r
is never actually used anywhere in check_curve_validity_lq()
except in if(r 0) {return(...)}
as an early check. This requires a bit more investigation to see whether the r
argument is necessary here.
{collapse}
- use functions directly, and use max()
and sum()
rather than fmax()
and fsum()
because base functions are more efficient.
quantile functions in md_compute_quantiles.R
that are efficient, utilize lorenz
argument, and wrap around md_compute_lorenz()
Improvements in efficiency are made to gd_compute_mld_lq()
and gd_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.
No relevant changes to the package in this version.
purrr
dependencysd_create_synth_vector
weighted_average_poverty_stats
) for repetitive calculation in adjust poverty stats and add corresponding test case for it. Initial release used in the PIP soft-launch on February 9, 2022
NEWS.md
file to track changes to the package.Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.