Given a set of populations \(P_i\) for age intervals \([x_{i-1},x_{i})\), \(i=1,\ldots,M\) the cumulative population at \(x_i\) is $$ N_i=\left\{ \begin{array}{ll} 0,& i=0\\ \sum_{k\le i } P_i,&\mathrm{otherwise} \end{array}\right. $$ Express age density as an exponential $$ p(a)=n_0 \exp(-\lambda(a)) $$ where \(\lambda(0)=0\). The first step is to build an age-density curve assuming \(\lambda(a)\) is constant in each age interval $$ \begin{eqnarray} n_0 &=& \frac{\Delta N_0}{\Delta x_0}\\ \clambda_i &=& -\log\left(\frac{1}{n_0}\frac{\Delta N_i}{\Delta x_i}\right)\quad i=0,\ldots,M-1 \end{eqnarray} $$ where \begin{eqnarray} \Delta x_i &=& x_{i+1}-x_i\\ \Delta N_i &=& N_{i+1}-N_{i} \end{eqnarray} The second step is to calculate \(\lambda_i\) at the internal points \(i=1,\ldots,M-1\) by linearly interpolating the \(\clambda_i\) $$ \lambda_i=\clambda_{i-1} \frac{x_{i+1}-x_i}{x_{i+1}-x_{i-1}}+\clambda_i \frac{x_i-x_{i-1}}{x_{i+1}-x_{i-1}} $$ \(\lambda_0\) and \(\lambda_M\) are calculated by assuming \(\lambda(a)\) is linear over \([x_0,x_1)\) and \([x_{M-1},x_M)\) $$ \begin{eqnarray} \lambda_0&=&\lambda_1+\LinLog(\exp(\lambda_1))\\ \lambda_M&=&\lambda_{M-1}+\LinLog\left(\frac{1}{n_0}\frac{\Delta N_{M-1}}{\Delta X_{M-1}}\exp(\lambda_{M-1})\right) \end{eqnarray} $$ Here \(y=\LinLog(x)\) is the function defined by $$ \frac{e^{-y}-1}{y} = -x $$ The last step is to solve for the curvature assuming \(\lambda(a)\) is piecewise quadratic over the internal age intervals.