A. First will test continuous = FALSE issue.
The problem is that when OPAG_r_min is called through the optimize sub, the continuous variable did not get passed to that sub (and subsequently OPAG_nLx_warp_r), the default value of continuous = TRUE is used, so the r value with the min value is based on continuous = TRUE, so it gives the same r_opt$minimum value, but different population results.
The formula for continuous = FALSE should be
w <- (1 - r) ^ (a1 + .5)
instead of
w <- (1 + r) ^ (a1 + .5)
When I corrected that problem and also the formula for the continuous = FALSE, the results come out very close (less than 0.001% different), but the r_opt$minimum values are different:
• For continuous = FALSE the value is -0.00398
• For continuous = TRUE the value is -0.00397
Thus, I think it would simplify things if the continuous option were dropped.
B. Ensure Lx is single ages once for use throughout
Since OPAG currently uses an interative process to find the optimal value of r, it does not make sense to need to split an abridged life table into single ages again and again. Instead, the main OPAG routine does the split (if needed) and the single year LT is then passed along through the other subs.
C. Make AgeInt not required for Pop and Lx
The AgeInt (age interval) variable is not needed for the Pop and Lx inputs because they can be inferred from the corresponding Age values.
D. Change default method to “mono”
The “uniform” method for graduation creates a step function, which does not work well with creating a single year stable population. However, further research is needed to make sure that the “mono” option does a reasonable job splitting the oldest ages. We switched the spline function from “hyman” to “monoH.FC” to make the splitting of 0 and 1-4 work better, but it is possible that “hyman” may work better at older ages. The “pclm” option seems very similar to “uniform” in graduate, with the default options, so “mono” seems best for now.
E. Change open age formula in warp function
Changed the formula for the average age in the open-ended age group from the original
This will tend to result in lower OPAG values than the original version. For a sample using CD West female level 25, with e80 = 80, the old OPAG uses 80.5 while the new uses 87.1. Another version, used in the past, would be ω + eω, which in this case would give 87.45. The original CD book (1966) used the formula:
abar80 = 80 + 0.6*e80 + 0.92
A. First will test
continuous = FALSE
issue. The problem is that whenOPAG_r_min
is called through the optimize sub, thecontinuous
variable did not get passed to that sub (and subsequentlyOPAG_nLx_warp_r
), the default value ofcontinuous = TRUE
is used, so the r value with the min value is based oncontinuous = TRUE
, so it gives the samer_opt$minimum
value, but different population results. The formula forcontinuous = FALSE
should bew <- (1 - r) ^ (a1 + .5)
instead ofw <- (1 + r) ^ (a1 + .5)
When I corrected that problem and also the formula for the
continuous = FALSE
, the results come out very close (less than 0.001% different), but ther_opt$minimum
values are different: • Forcontinuous = FALSE
the value is -0.00398 • Forcontinuous = TRUE
the value is -0.00397 Thus, I think it would simplify things if thecontinuous
option were dropped.B. Ensure Lx is single ages once for use throughout Since OPAG currently uses an interative process to find the optimal value of r, it does not make sense to need to split an abridged life table into single ages again and again. Instead, the main OPAG routine does the split (if needed) and the single year LT is then passed along through the other subs.
C. Make AgeInt not required for Pop and Lx The AgeInt (age interval) variable is not needed for the Pop and Lx inputs because they can be inferred from the corresponding Age values.
D. Change default
method t
o“mono”
The“uniform”
method for graduation creates a step function, which does not work well with creating a single year stable population. However, further research is needed to make sure that the“mono”
option does a reasonable job splitting the oldest ages. We switched the spline function from“hyman”
to“monoH.FC”
to make the splitting of 0 and 1-4 work better, but it is possible that“hyman”
may work better at older ages. The“pclm”
option seems very similar to“uniform”
ingraduate
, with the default options, so“mono”
seems best for now.E. Change open age formula in warp function Changed the formula for the average age in the open-ended age group from the original
w1Lx <- exp(-r * (a1 + .5)) * Lx1
to:
This will tend to result in lower OPAG values than the original version. For a sample using CD West female level 25, with e80 = 80, the old OPAG uses 80.5 while the new uses 87.1. Another version, used in the past, would be ω + eω, which in this case would give 87.45. The original CD book (1966) used the formula: abar80 = 80 + 0.6*e80 + 0.92
Which in this case would be 85.39.
OPAG notes and questions2021-05-31.docx Considerations for testing projections using stable populations.docx