beers

Introduction

The beers package provides the Beers ordinary and modified methods for interpolating between 5-yearly points, and subdividing 5-yearly agebands. The most likely usage is with demographic data that has been presented at 5-yearly intervals, or in 5-yearly age-bands. The Beers algorithm can be used to interpolate, or subdivide those data respectively, and is notably used by UNWPP for that purpose.

Background

The original algorithms were created by Henry S. Beers. I have not been able to locate these papers, but for the ordinary and modified methods respectively, the original papers are:

  • “Discussion of Papers Presented in the Record, No. 68: ‘Six-Term Formulas for Routine Actuarial Interpolation’, Henry. S. Beers, The Record of the American Institute of Actuaries 34, Part I(69): 59-60, June 1945.
  • “Modified Interpolation Formulas that Minimize Fourth Differences.” Henry S. Beers, The Record of the American Institute of Actuaries 34, Part I(69): 19-29, June 1945.

The coefficients are published in:

But note that there are two typos in this edition:

  • p728, Beers Ordinary Interpolation, Middle Interval, N3.0, fourth column should be 0.000, not 1.0000
  • p729, Beers Modified Interpolation, Last Interval, N5.6, 5th number should be +.8592, not +.8529. (See the symmetrical entry in First Interval, N1.4)

Usage - how?

Calling the functions is simple.

beers_int_ordinary(c(1, 2, 4, 8, 16, 32))
#>  [1]  1.0000  1.1061  1.2696  1.4780  1.7229  2.0000  2.3092  2.6545  3.0437
#> [10]  3.4879  4.0000  4.5931  5.2791  6.0681  6.9701  8.0000  9.1793 10.5355
#> [19] 12.1007 13.9100 16.0000 18.4083 21.1732 24.3336 27.9291 32.0000
beers_int_modified(c(1, 2, 4, 8, 16, 32))
#>  [1]  1.0000  1.1672  1.3435  1.5362  1.7526  2.0000  2.2856  2.6165  3.0003
#> [10]  3.4445  3.9570  4.5464  5.2227  5.9982  6.8887  7.9140  9.0979 10.4676
#> [19] 12.0529 13.8859 16.0000 18.4296 21.2095 24.3746 27.9598 32.0000
beers_sub_ordinary(c(10, 20, 40, 80, 160))
#>  [1]  1.061  1.635  2.084  2.449  2.771  3.092  3.453  3.892  4.442  5.121
#> [11]  5.931  6.860  7.890  9.020 10.299 11.793 13.562 15.652 18.093 20.900
#> [21] 24.083 27.649 31.604 35.955 40.709
beers_sub_modified(c(10, 20, 40, 80, 160))
#>  [1]  1.672  1.763  1.927  2.164  2.474  2.856  3.309  3.838  4.442  5.125
#> [11]  5.894  6.763  7.755  8.905 10.253 11.839 13.697 15.853 18.330 21.141
#> [21] 24.296 27.799 31.651 35.852 40.402

The interpolations require at least 6 points - for example, population in 1950, 1955, 1960, 1965, 1970 and 1975, hence providing 5 panels between the points, in which to interpolate. Subdivisions require at least 5 points to be subdivided - for example, population in age range 0-4, 5-9, 10-14, 15-19, 20-24.

The ordinary algorithms have two particular properties:-

  • For interpolation, all of the original data points (ie, 1950, 1955, 1960…) are unchanged by the algorithm; interpolation occurs between the points.
  • For subdivision, every subdivided set of 5 populations sums to the original value - (ie, population for ages 5, 6, 7, 8, 9 will sum to give the original 5-9 value.)

The modified algorithms cause extra smoothing to be carried out, such that:-

  • For interpolation, only the first and final data point’s values are preserved; the interpolation provides new values for all the intermediate points, including those for which you provided data.
  • For subdivision, only the first, and the final age-bands have the property that the sub-divided populations sum to the original age-band population.

Usage - why?

When writing the package, the purpose was to replicate as exactly as possible algorithms used by UNWPP in their population interpolations, using the exact values given in the published tables. Presumably these figures are truncated from a some function that is possibly documented in the 1945 paper, if only we could find it.

There are other options for interpolation of course, and perhaps the Beers algorithm here is approximately equivalent to one of the interpolation options available in R.

Results are fairly inconclusive. So, it looks like you should use the Beers library if you really specifically want Beers; otherwise, you might as well look into R’s spline function for more flexible and documented options!