Search interesting materials

Thursday, January 25, 2018

PenCalc: A tool for simulating pension outcomes

by Renuka Sane.

Policy decisions on pensions should be shaped by an evaluation of the link between various parameters of the pension scheme and potential outcomes. For example, the setting of fees, investment guidelines, annuity policies, should be designed after a careful study of how these will affect the pension received. This is especially important in defined-contribution pension systems where there is considerable uncertainty about returns that may be obtained. Pension outcomes must, therefore, be understood through the lens of the risk-return trade-off.

This article presents penCalc, a new open source software system developed for conducting simulations on pension outcomes. It allows the key variables that may affect the pension to be changed, and presents the user with a range of possible pension amounts. This can help policy makers evaluate the impact of a policy change on pension outcomes. This can also be used by individuals for retirement planning.


penCalc simulates pension scenarios based on assumptions on age of entry, exit, wage growth, contribution rate, portfolio allocation, asset returns, annuity prices, and inflation. It is developed using R, an open source programming language and software environment for statistical computing, supported by the R Foundation for Statistical Computing. The package may be installed as follows:



The default assumptions made in penCalc are shown in Table 1. They have been chosen to be as close as possible to the National Pension System (NPS) in India. For example, the age at exit is the current retirement age. The returns assumptions are derived from a study of the Indian financial environment. The life-cycle allocation is sourced from the Deepak Parekh Committee Report set up by the PFRDA in 2009 on investment allocations. In a life-cycle portfolio allocation, the exposure to equity is very high at younger ages, and gradually reduces as one approaches retirement. The fees and expenses also reflect the current AUM charges in the NPS, as well as the flat fee charged by the Centralised Record-keeping Agency (even though this may not be exactly INR 100). The annuity price is taken from the current offerings of the Jeevan Akshay policy of the Life Insurance Corporation of India.

Table 1: Assumptions
Age of entry 25
Age of exit 60
Wages and contributions
Starting wage INR 25,000 per month.
Wage growth (nominal) 8% per annum
Contribution rate 20% of wage
Initial amount (already in the account) 0
Inflation (mean, sd) (4%, 0)
Investment portfolio Life-cycle
Returns (nominal)
GOI bonds (mean, sd) (7%, 0)
Corporate bonds (mean, sd) (10%, 0)
Equities (mean, sd) (16%, 25%)
AUM 0.01%
Flat fee INR 100 p.a.
Annuity parameters
Percent to be annuitised 40%
Price for an INR 1 a day nominal
INR 4,087

These default numbers can be changed to reflect different views on NPS rules as well as the Indian macroeconomic environment. The tool can also be used for pension income simulation with assumptions that reflect the environment in different countries.

Using penCalc

The structure of the code is given below. The function consists of various parameters, and the default values set against the parameters. For example, age.entry is set to 25, while age.exit is set to 60. All of these parameters can be changed.

  x <- pencalc(age=list(age.entry=25,     
       inflation=list(c(0.04,0), real=TRUE),        
       returns=list(data.frame(mean=c(0.07, 0.10, 0.16), 
                                      sd=c(0, 0, 0.25)),
                    c(monthly.fees.expenses=0.01, 100)),
         annuity=list(perc.annuitised=0.4, value=4087))

How the model works

The starting wage and the yearly growth rate in wages are used to generate a vector of wages for the years the subscriber is expected to be in the system. The number of years is calculated as the difference between the age of entry and exit. In this particular instance, the number of years is 60-25+1, that is 36 years.

The contribution rate is then used on this vector of wages to arrive at the rupee value of contributions made each year in the NPS. The wages are expected to stay the same in each month of the year. For example, in this case, the contributions will be 20% of the wage of INR 25,000 in the first year.

The returns on each instrument are simulated from a normal distribution with the mean and standard deviation of that particular instrument. The investment weights and returns are used to arrive at a portfolio return. The monthly fees and expenses are deducted from the portfolio returns. The contributions and returns are accumulated over each year in the system and give us the total accumulation in the pension account.

If the user has entered the "real=TRUE" option, then the rate of inflation is subtracted from all inputs. The results of the model in such a case will be in terms of today's rupee value, and not nominal values. The default inflation rate is 4%, but as discussed earlier, this can be easily changed.

The simulation is done 1,000 times and generates a distribution of accumulated amounts in the NPS account. The amount to be annuitised (for example 40%) is subtracted from this accumulation. The annuity price is used to arrive at the monthly pension that can be purchased with this amount. The remainder (for example 60%) is available as a lump sum withdrawal. The model has the following outputs:

  1. In hand accumulation: This is the average amount of lump sum withdrawal available at retirement. In the case of 40% annuitisation, the in hand accumulation is the remainder 60% of the total accumulated balances. In the case of full annuitisation, this amount will be zero, as the entire accumulation is turned into an annuity.
  2. Monthly pension: This is the rupee value of the average monthly pension the retiree can expect to get after the purchase of the annuity.
  3. Replacement rate: This is the ratio of the pension to the last drawn wage. The replacement rate only makes sense for government employees. For those with varied contributions over their lifetime, it is not sensible to divide the pension with the last wage. The replacement rate should be ignored for subscribers other than regular salaried employees.

Example 1: Portfolio dominated by GOI bonds

This example demonstrates the use of the calculator for an investment allocation between government bonds and equity of 85%and 15% respectively. We have chosen the real=TRUE option. Hence all the results are in 2018 rupees.

Since the example is using all the default values and only changing the investment weights (as the default weights are the life cycle model), we change that parameter in the model. We first create a weightmatrix where we specify the portfolio allocation into government debt and equity. We then supply the weightmatrix to inv.weights. The code is as follows:

weightmatrix <- data.frame(goi_bonds=rep(0.85, 36), 
# 40% annuity
x <- pencalc(inflation=list(c(0.04,0),real=TRUE),

# 100% annuity
y <- pencalc(inflation=list(c(0.04,0), real=TRUE),
             annuity=list(perc.annuitised=1, value=4087))

Table 2 describes the results. The first three columns show the results for 40% annuitisation, while the next three show the results for 100% annuitisation. The results are in "real" terms. The numbers in the bracket represent the standard deviation - this reflects the uncertainty around the average lump sum and pension amounts.

Table 2: Portfolio dominated by GOI bonds
100% annuitisation
Average 10th percentile 90th percentile Average 10th percentile 90th percentile
Monthly Pension (in Rs.) 23,297 (828) 22,196 24,361 58,242 (2072) 55,491 60,902
In hand accumulation (in Rs. million) 4.7 (0.17) 4.4 4.9 0.0 (0.0) 0.0 0.0
Replacement rate 23.6 (0.80) 22.5 24.7 59.0 (2.1) 56.2 61.7

With 40% annuitisation, the average pension at the age of 60 is INR 23,297. This provides an average replacement rate of 24%and also provides a lump sum withdrawal of INR 4.7 million. Pension at the 90th percentile of the distribution is INR 24,361, while at the 10th percentile is INR 22,196. The replacement rates are 25% and 22% respectively.

With 100% annuitisation, the average monthly pension increases to INR 58,242 and the replacement rate to 59%. The 90th percentile of this distribution is INR 60,902, with a replacement rate of 62% while the 10th percentile is 55,491 with a replacement rate of 56%.

Example 2: Life-cycle portfolio investment

The previous example is heavily skewed towards government bonds. Given the huge equity premium in India, it is useful for the NPS to invest more heavily in equities. One way of increasing equity exposure is through a life-cycle portfolio allocation. The current example uses the default life-cycle portfolio weights indicated by the "lc" option. However, these weights can also be changed. The code is as follows:

# 40% annuity
x <- pencalc(inflation=list(c(0.04,0), real=TRUE),
# 100% annuity
y <- pencalc(inflation=list(c(0.04,0),real=TRUE),
             annuity=list(perc.annuitised=1, value=4087))

Table 3 describes the results. The average pension at the age of 60 is INR 36,744 with 40% annuitisation. This provides a replacement rate of 37% and also leaves a lump sum amount of INR 7.4 million. The average here is higher than that obtained using a portfolio dominated by government bonds. However, the standard deviation is also higher, suggesting that the risk is higher. This is not surprising because the exposure to equity is higher in the life-cycle investment portfolio.

Table 3: Life-cycle portfolio investment
40% annuitisation 100% annuitsation
Average 10th percentile 90th percentile Average 10th percentile 90th percentile
Monthly Pension (in Rs.) 36,744.3 (3702.4) 32,017.9 41,462.0 91,860.8 (9256.1) 80,044.7 103,654.9
In hand accumulation (in
Rs. million)
7.41 (0.75) 6.45 8.35 0.0 0.0 0.0
Replacement rate 37.2 (3.80) 32.4 42.0 93.1 (9.4) 81.1 105.1

Pension at the 90th percentile of the distribution is INR 41,462, with a replacement rate of 42%, but at the 10th percentile is INR 32,018 with a replacement rates of 32%. Full annuitisation provides an average monthly pension of INR 92,000 and a replacement rate of 93%. At the 10th percentile, the replacement rate drops to 81%, but at the 90th percentile it jumps up to 105%.

Example 3: Varying contribution rates

The assumption of a constant contribution rate is not realistic in the case of informal sector workers. The model handles this by using a vector of wages, and a contribution rate of 100% in the model. This effectively makes the values entered in the wage the actual contribution. In the example described below, we simulate 36 values for wages from a normal distribution with a mean of INR 3,000 and a standard deviation of INR 100. We then use a contribution rate of 100%. The code is as follows:

wage = round(rnorm(36, 3000, 100),0)
# 40% 
x <- pencalc(wage=list(wage,
#100 %
     y <- pencalc(wage=list(wage,
                  inflation=list(c(0.04,0), real=TRUE),
           nnuity=list(perc.annuitised=1, value=4087))

Table 4 presents the results. As the replacement rate is meaningless in this context, it is not shown in the table. An informal sector worker with average monthly contribution of INR 3,000 every year for 36 years, can expect an average monthly pension of INR 13,454 with 40% annuitisation, or an average monthly pension of INR 33,635 with 100% annuitisation.

Table 4: Varying contribution rates
100% annuitsation
Average 10th percentile 90th percentile Average 10th percentile 90th percentile
Monthly Pension (in Rs.) 13,454 (1698.3) 11,305.8 15,623.4 33,635.2 (4,245.9) 28,264.5 39,058.5
In hand accumulation (in
Rs. million)
2.7 (0.34) 2.3 3.1 0.0 (0.0) 0.0 0.0


penCalc is a new open source software system developed to model pension outcomes. It allows the key variables of interest to be changed - and sets out a range of plausible outcomes using data on returns, equity premium and income from annuities purchased at retirement. The results are averages from the simulation. It is, therefore, useful to also look at the standard deviation to get a complete picture of the possible outcomes. As has been demonstrated in the examples, the outcomes can vary considerably, and retirees must factor in this uncertainty as they do their financial planning.

A recent working paper, Simulating Pension Income Scenarios with penCalc: An Illustration for India's National Pension System, demonstrates many examples of the use of this tool for different assumptions of equity returns, and annuity prices. We hope this software becomes a useful tool for policy makers and regulators as they develop pensions policy.


Renuka Sane is an associate professor at the National Institute of Public Finance and Policy. I thank Arjun Gupta for collaboration on the software development, William Price for collaboration on the working paper. The work was supported through the FIRST Initiative in funding the engagement with India's Pension Fund Regulatory and Development Authority.


  1. The current framework by its design has the potential to underestimate the uncertainty in terminal value of the maturity amount. This is due to the following features of the framework:

    1) bond returns and equity returns are extracted independently:

    In reality, they will be correlated. Years of credit crisis (i.e. years of high default rate in bonds) will also impact equity return or vica-versa. Joint random extraction from a correlated distribution of bond and equity returns will tend to increase the volatility in terminal maturity value.

    2) the framework has no place to incorporate correlations between consecutive years:

    Incorporating correlation between consecutive years (in terms of bond and equity returns) will give us a more realistic picture of the volatility in the terminal value.

    Other issues:
    a) Problem with bond return framework:
    The base illustration assumes that the bonds are risk free (standard deviation are zero). However, even if we want to use a non zero standard deviation and simulate bond return from normal distribution, the simulation output would be very non-intuitive as this would also produce cases of return which would be more than contractual rate. Hence, in order to incorporate risk in bond, a different framework would be required. This framework can be conditioned upon expected default and recovery rate (i.e. PD and LGD) of bonds of different ratings.

    b) Number of simulations are less:
    Given the number of dimensions ( 20-30 year horizon, type of investment options), 1000 simulation appears to be too less. This would tend to produce different result every time. A better approach would be to take resort to multi dimensional numerical integration

  2. Thank you for these comments. We hope to incorporate some of these in the next version of the package.

    1. thanks, if required, will be happy to add more details

    2. Can I suggest an analytical approach in place of the stochastic simulation approach?

      Thiis will remove the random nature of the output given by current methodology which uses stochastic simulation

    3. There seems to be a error in the calculation given on page 22, table 3.

      Given a salLsry of 300000 per year, 20% contribution, Assuming 100% in government bond of 3% annual return, the terminal value of bond portfolio itself would be equal to around 15 million, after 40% annutization, we are still left with 11 million.

      The paper report this number as 4.6 million assuming 85% in gov bond and 15 percent in equity

      This looks very odd as equity should have led to increase the reported number and should have been more than 11 million

      Probably It seems that inspite of using real return in the calculation, the terminal value has been discounted again to get present value

    4. ignore my previous comment on calculation error, There was some error in my calculation, after rectifying my calculation, I also got the same number (4.6 million)

    5. I have quantified the impact on volatility of terminal value due to correlation parameters. However, the blog do not allows me to send. seems there is some word limit

    6. I am writing the details of the methodology and its numerical illustration. This will show the impact of bond risk, intra return correlation and autocorrelation on levels and distribution of terminal value. This will still be using stochastic simulation methodology. The numerical integration methodology will be provided latter.

      Due to size, I am sending in two parts. I will first send the methodology followed by numerical illustration

      The next two consecutive comments are continuation of this

    7. Methodology Part 1:

      This note is intended to illustrate the methodological details and resulting numerical impact of the following issues on the probability distribution of terminal value.

      Issue 1: Default Risk of Bonds
      Issue 2: Correlation between default risk of bonds and equity return
      Issue 3: Correlation between consecutive years in returns:

      As expected, volatility of the terminal value is relatively less impacted by the default risk of the bonds. The major components of volatility are the correlation factors. Secondly, the resulting distributions are skewed to such level that the average generally coincides with the 75th percentile of the distribution. As a result, average and standard deviation would not be an intelligent way of reporting the results. Hence, I have reported percentile values to illustrate the volatility.

      The methodology used is monte carlo simulation only. The alternate numerical integration methodology will be provided later.

      The note is arranged in the following sequence:

      1) Methodology
      2) Numerical Illustration :


      The methodology has the following components:

      1) Extraction of Annual Systematic Risk Factors for Different Investment Types (Sovereign Bond, Corporate Bond & Equity)

      2) Conversion of Annual Systematic Risk Factors to Annual Returns

      3) Calculation of terminal value by applying returns on contributions:

      The three components are discussed below:

      1) Extraction of Returns: Annual Systematic Risk Factors for Different Investment Types (Sovereign Bond, Corporate Bond & Equity)

      a) General Economy Level Systematic Risk Level (X(t) where t=1 to 36): For year 1, X(1) is randomly extracted from N(0,1), X(2) is so extracted such that X(2) has a given correlation (r1) with X(1). In other words, if X(1) equal k, then X(2) is extracted from a normal distribution with mean and standard deviation equal to r1*k and sqrt(1-(r1^2)). This is done by the equation:

      X(2)=r1*X(1)+sqrt(1-(r1^2))*random N(0,1)

      b) Sovereign Systematic Risk Level (S(t) where t=1 to 36): This is considered as equal to X(t). Hence, we assume a 100% correlation between general economy and sovereign risk

      c) Corporate Bond Systematic Risk Level (C(t)): C(t) is so extracted such that C(t) has a given correlation (r2) with X(t). This is done by the equation:

      C(t)=r2*X(t)+sqrt(1-(r2^2))*random N(0,1)

      d) Equity Systematic Risk Level (E(t)): E(t) is so extracted such that E(t) has a given correlation (r3) with X(t). This is done by the equation:

      E(t)=r3*X(t)+sqrt(1-(r3^2))*random N(0,1)

      It is to be noted that since, sovereign, corporate bond and equity systematic risk factors are correlated with general economy level systematic risk factor, they are correlated among themselves. In addition, since general factor is correlation across time also, the same applies for the other three factors also.

    8. Methodology Part 2:

      2) Conversion of Annual Systematic Risk Factors to Annual Returns

      a) Return for sovereign bond:

      Given the fact that there is only one sovereign, we cannot apply the concept of PD here. In this case, if sovereign defaults, the contractual rate is not realised. Otherwise it is realised. Hence, we have the the following mathematical rule:

      If sqrt(Rsq)*S(t)+sqrt(1-Rsq)*random N(0,1)<=normsinv(PD) then default and hence return=0%, otherwise return=contractual rate

      Please note that the above rule is taken from default generation process of credit-metric uni variate latent factor model. PD is through the cycle estimate of default risk and Rsq denotes the square of correlation of sovereign assets with S(t)

      b) Return for Corporate bond:

      We assume a adequately large number of corporate bond issuers at each rating. Hence, we can apply the concept of PD. Given the values of TTC PD and Rsq, we can calculate the point in time pd of year t (i.e. pit_pd(t)) by the following expression:

      pit_pd(t)=normsdist ( (normsinv(ttc_pd) - sqrt(Rsq)* C(t))/(sqrt(1-Rsq)))

      Given the value of PIT PD for year t, we can calculate the return as follows:

      corporate_bond_return (t) = (1-pit_pd(t))*contractual_rate

      c) Equity Return:

      Given the choice of equity systematic risk factor E(t), the first task is to derive its percentile value. For example, if E(t) equal -1.64 then its percentile equal 5%. Once we know the percentile value (i.e. 5%), our equity return is 5th percentile from a normal distribution with a given mean and standard deviation of unconditional distribution of equity return.

      Given the mean and standard deviation in the paper (16% and 25%), the resulting equity return equals -25%.

      Hence, we derive equity return by using the following formula:


      3) Calculation of terminal value for a contribution by applying returns on contributions:

      The portfolio value for any year t for a particular investment option is calculated by the following expression:

      portfolio_value(t) = (portfolio_value(t-1))*(1+return) + (annual_contribution(t)*(1+(annual_return*50%));

      Please note using 50% of annual return to current year contribution will give us very close results to the case if we would have used monthly return.

    9. Numerical Illustration:

      Numerical Illustration

      In order to show the impact on probability distribution of terminal value, we first consider a base portfolio with lowest possible default risk. In addition, all the correlation parameters are assumed to be equal to zero. Hence, except for sovereign, corporate and equity risk is not correlated to general economic risk factor. Neither is there any correlation between risk of any two time periods. The characteristics of the base portfolio is summarised below:

      1) Monthly investment of INR 1 for 36 years. In other word, Rs 12 investment for each year

      2) The contribution is equally divided in 3 options (i.e. 1/3 each for all three investment options sovereign bond, corporate bond and equity)

      3) TTC PD (Sovereign) = .001% & TTC PD (Corporate) = .001%

      4) Rsq (Sovereign) = 50% & Rsq (Corporate) = 20% : (Please note that sovereign have generally higher factor loading than corporates)

      5) r1=r2=r3=0

      The average, 25th percentile. 50th percentile & 75th percentile of the terminal value by using 10K simulation is estimated as (7.5 K INR, 3.3 K INR, 4.9 K INR, 8.3 K INR).

      In order to understand the impact of default risk of sovereign and corporate bond, we alter the base portfolio by the increasing the TTC PD of corporate and sovereign bond to 6% each. We chose 6% for sovereign because this has been the observed default rate for BB- Local Currency ratings (by standard & poor). The corporate PD is chosen as equal to sovereign PD.

      The change in the base case does not significantly change the 25th,50th and 75th percentile values. The average has obviously decreased to 7.3K INR. Hence, as a conclusion, impact of bond default risk on the probability distribution of the terminal value is not so prominent.

      The average, 25th percentile. 50th percentile & 75th percentile of the terminal value by change in sovereign and corporate PD is estimated as (7.3 K INR, 3.1 K INR, 4.7 K INR, 8.1 K INR).

      In order to understand the incremental impact of correlation parameters, we alter the base portfolio, by changing the correlation parameters. We set r1=50%, r2=100% and r3=100%. Rest of the parameters are same as the base case

      r1=50% implies that correlation between any two year equals 50%. We chose 50% as this would imply close to around 1% correlation between year 1 and 6. This is a way of saying that any credit cycle loses its memory after 5 years. r2=r3=100% implies perfect monotonically between general economy & bond/equity.

      After changing the correlation parameters, the resulting probability distribution becomes very highly fat tailed towards higher terminal value.

      The average, 25th percentile. 50th percentile & 75th percentile of the terminal value by increase in correlation parameters is estimated as (19.5 K INR, 2.6 K INR, 5.1 K INR, 14 K INR).

      The above mentioned distribution is much larger than that of the base case. In addition, even the average is too high.

    10. is the above methodology okay?

      if okay, I will add the numerical integration part to it

  3. A possible approach to incorporate the following properties in the simulation framework is as follows.

    The properties to be incorporates as as follows:

    1) risk of bond returns
    2) correlation between bond return and equity return
    3) correlation between consecutive years:

    1) Bond return for first year

    For year 1 ,extract a latent credit risk factor (c1) from standard normal distribution. Assume there are bonds with known rating in the chosen portfolio. From historical data, we can derive the through the cycle PD (TTC PD) and factor Loadings (Rsq) of these ratings. Given the extracted credit risk factor, we can derive the point in time annual PD of these two ratings by using conditional PD formula as given by Vasichek. Given these calculated default rates, we can calculate the expected value of return of the bond portfolio. In summary, for a bond with given point in time PD (pit pd) and contractual rate (r), expected return would be equal to (1-pit pd) multiplied by contractual return

    2) Equity return for first year

    For year 1, given bond return (c1), extract equity return (e1) such than e1 has a given correlation with c1 and also has an unconditional distribution like standard normal distribution. Roughly, one can use the following formula:

    e1=correlation*c1 + sqrt(1-correlation^2) *random N(0,1).

    Given the extraction of e1, we can chose the corresponding percentile from unconditional marginal distribution of equity return. For example, given e1 equal zero, we need to chose 50th percentile of equity return from unconditional marginal distribution of equity return

    3) Returns for consecutive years:
    For year 2, extract c2 such than c2 has a given correlation with c1 and also has an unconditional distribution of N(0,1). Roughly, one can use the following formula:
    c2=time-correlation*c1 + sqrt(1-time-correlation^2) *random N(0,1). Given c2, extract e2 using the methodology given in step 2


Please note: Comments are moderated. Only civilised conversation is permitted on this blog. Criticising me is perfectly okay; uncivilised language is not. I delete any comment which is spam, has personal attacks against anyone, or uses foul language. I delete any comment which does not contribute to the intellectual discussion about the blog article in question.

Please note: LaTeX mathematics works. This means that if you want to say $10 you have to say \$10.