1 Introduction

Over the last three decades in Mexico, reforms to the pension systems have created significant benefits for Mexican workers. During the nineties, an individual capitalization (pension) system was developed because of the reforms in the Social Security Law of 1995, which allowed the creation of a defined contribution system in 1997. The objective of such a pension system is that the employer grants an annual or monthly monetary contribution based on the worker’s salary. In other words, the employer pays a certain percentage of the employee’s salary towards a retirement pension fund. Today, Mexico has more than 60 million individual savings accounts for workers employed in the formal job sector. Likewise, with the digitization of the processes, which is promoted by the National Commission of the Retirement Savings System (CONSAR), technological improvements have been made, including the incorporation of bio-metric data (Azuara et al. 2019). Mexico is in a demographic transition characterized by a sustained aging rate. The percentage of the population over 65 years of age will more than double in approximately 15 years from what it is now. That is a severe problem and people who do not work formally will likely not have a system that provides adequate coverage for their future retirement, see for instance Cantú (2015).

In Mexico, for example, the social security system is currently fragmented. There are more than 1000 contributory and non-contributory pension programs with no apparent connection between them. Thus, by not having a single institution with a comprehensive vision of pension systems tasked with an efficient long-term planning, problems are exacerbated.

Contributory pension systems require certain conditions to be able to retire workers. For example, the Mexican Institute of Social Security Law states a minimum number of weeks of contributions and an age minimum (IMSS 1997). It follows that an employee who satisfies these conditions is guaranteed to be able to retire with their savings in their retirement fund at the end of their productive life. There are many articles that address the problem of pensions in different countries. However, most of them have a focus on government policies aimed at encouraging retirement savings plans at an early age. In the same way, groups of workers who have different professions and who work in state or federal administrations are usually analyzed. There are a few examples of articles that address the problem of retirement savings from the perspective kept in the present work. By way of comparison, below we show some of the articles that can be found in the literature and the various methodologies used in them.

In the paper “The effect of pension design on employer costs and employee retirement choices”, Chalmers et al. (2014) established that employers must weigh the expected benefits of the pension plans that they offer to employees with the expected costs. The data of the retirement system of employees of the public service of the state of Oregon in the USA were used. The analyzed period ranges from 1990 to 2003.

The fundamental idea, in this case, was that creating generous pension plans allows employers to attract and retain higher-quality employees. The governor of the state emphasized these potential benefits in 1967 when he pushed for reform of Oregon’s Public Employees Retirement System (PERS).

The increase in anticipated retirement benefit payments imposes a direct cost on employers who must cover the larger pension payments. It can also impose indirect costs to the extent that changes in plans affect employee behavior. One of the important conclusions of the work is that it was shown that employees respond to retirement incentives that showed variations in a year and in which several of the workers are benefited. This is a very large study that considers various retirement planning scenarios and different groups of people. However, the universe of workers is different from that of our study. This is because the population we analyze are university professors who normally do not perform physical work as demanding as some of the jobs analyzed in Chalmers et al. (2014). An example is that of police officers and firefighters. In these cases, workers are more likely to retire during the first month those employees are eligible for the retirement program. On the contrary, in the case of the population of university professors studied in this article, we consider that a large number of employees close to retirement age will decide to remain in the proposed retirement savings fund because this will increase their savings for the retirement plan.

In Auerbach and Lee (2011) the authors analyzed how public pension structures distribute the risks that result from demographic and economic contrasts between generations. Authors considered real and hypothetical pension structures, including (1) versions of the US Social Security system with annual tax adjustments; (2) Sweden’s Theoretical Defined Contribution system, and (3) the German system, which also includes annual adjustments to maintain fiscal balance. For each system, they presented descriptive measures of uncertainty in the representative results for a typical generation and between generations. At the end, they estimated the expected utility and incorporated these calculations into a general measure of social welfare.

In previous work Lee and Tuljapurkar (1998) used a stochastic simulation model developed to assess the risk-sharing characteristics of these public pension systems. In this model, the logarithm of each mortality rate was taken as a linear function of a single mortality rate. This index was modeled as a random drift walk in Lee and Carter (1992). In contrast to our work, this article includes some additional variables that contribute to the model, such as the average fertility of the female population. It also considers the effect of the incorporation of the new generations in the population that contributes to the pensions of previous generations.

Finally, we found some research related to our approach. For example, in Mielczarek (2013) the so-called second pillar of the Polish pension system was changed. The government lowered the amount for obligatory contributions transferred to private open pension funds and redirected the difference to notional accounts. A Monte Carlo simulation model was performed to compare the two versions of the Polish pension system.

As can be seen from the investigation of these authors, the pension plan in Poland was radically modified in 1999 through a legislative act. Before that year, the pension system was financed solely by contributions from employers with a pension rate of almost 100% of an employee’s salary. In the modified system, a percentage of income was included for each individual account, divided between the employee and the company. Part of the contribution is administered by the Social Security Institute (ZUS) and another part is administered by private pension funds. This new system is called three-pillar because workers have the option of a third individual pension account. The experiments were conducted simultaneously for two variants of the pension systems, and the identical values of macroeconomic forecasts were defined as the input data. This article is an attempt to make predictions based on mathematical models. To compare two variants of the Polish pension system, a Monte Carlo (MC) simulation model was developed: (1) the old system with a fixed percentage and interest earned as a result of real financial market mechanisms and (2) the current system with premiums divided into two independent flows, one of which is accumulated in the notional account and is indexed according to the rules defined by the government. The simulations made it possible to calculate the economic implications of the new strategy of the pension system from the perspective of the individual worker and to compare the results of the previous system, assuming the same macroeconomic circumstances. Terminal value and investment risk were used to compare both systems. The analysis referred to the second pillar, and only a simulation was carried out for the part of the contribution that had previously been transferred to the private open pension funds and that is now deposited in two different accounts (public and private). The experiments were carried out simultaneously for two variants of the pension systems and identical macroeconomic forecasts were used as input data.

Indeed, the Polish pension plan shows outstanding characteristics that make it very attractive to workers. At the same time, the fact that there is a plan with three different contributions allows different strategies to be introduced to increase workers’ savings. In the case of Mexico, originally there was a 1973 law that contemplated pensions that were largely covered by the contributions of new generations. Subsequently, the 1997 law appeared, which radically modified the previous one. The new law contemplates the figure of Administrators of Retirement Funds (AFORE) where only the contributions generated by the worker himself are accumulated.

This article is structured as follows. In Sect. 2, the problem of pensions in Mexico is established. Some data from the Mexican Social Security Institute and INEGI are shown, describing the current scenario related to the lack of retirement savings plans for Mexican workers. In Sect. 3, the data collection of this article is analyzed. The information compiled by the National Commission of the Retirement Savings System (CONSAR) in Mexico deserves special attention. In Sect. 4, the conceptual model used is briefly described. Section 5, the computational model used in this work is analyzed in detail. In particular, the code of the Arena software that was used for the computational simulation is described. Similarly, the R code used is described, which was also included as an appendix at the end of the article. Section 6 corresponds to the life table. A life table or mortality table is a theoretical model that describes the extinction of a hypothetical or fictitious cohort. It allows us to determine the probabilities of surviving or dying at an exact age. Section 7 describes the results obtained from the computational simulation. Different scenarios are analyzed that correspond to different cases analyzed in the computational model. Finally, in Sect. 8, we provide our conclusions and final comments about the perspectives of this work.

2 Problem statement

Mexico has various pensions and programs in place that help plan for a dignified retirement. Two of these pension models are non-contributory and contributory pensions. On the one hand, the government assigns non-contributory allowances to certain people who, due to special conditions, cannot obtain a decent income. On the other hand, contributory pensions are those in which the worker, in coordination with their employer, grants contributions to an intermediary institution that stores and takes care of the worker’s savings through a financial program.

A new law regulating retirement was published in (IMSS 1997). This new law appeared after various changes in living conditions. One of those changes in living conditions is related to the average increase in life expectancy of Mexicans. According to the National Institute of Statistics and Geography (INEGI 2008), life expectancy has increased considerably: In 1930, people lived for only an average of 34 years; over time, it reached 40 years. By 1970, life expectancy had reached 61 years on average, and then in 2000, the average was up to 74 years of age. More recently in 2016, it had reached 75.2 years. In the old social security law, the resources granted to retirees came directly from economically active people. However, data from the National Institute of Statistics and Geography (INEGI 2008) show that the birth rate decreased by 50% between 1970 and 1990. This decrease in eligible taxpayers will likely generate a deficit in funds to cover people’s retirement income in the next few years.

Similarly, a worker who earns a relatively low salary throughout their lifetime can result in an underfunded retirement. Some institutions took the initiative and opted to create their own retirement systems that help their workers obtain a decent pension at the time of their retirement. For this purpose, a simulation model was developed to study an internal retirement plan at one institution of higher education in Mexico. The stochastic model presented here considers that the faculty join with different salaries, ages, seniority, and personal preferences for their retirement, determined by random variables. This new model complements the deterministic model suggested by Montufar et al. (2021).

3 Data collection

The retirement savings program of the educational institution established important criteria that faculty must have to be eligible for the program. The primary criterion is that the faculty member must belong to the academic personnel union. This condition guarantees that the faculty member receives all the benefits established by the collective bargaining agreement fairly and legally. An important element to consider within the model is the worker’s salary since these are not the same for all faculty. In higher-level educational institutions, there are different types of positions for which the staff is hired. These positions vary according to experience, level of studies, publications, etc.

An essential part of the simulation model is the percentage of salary that both the faculty and the institution will contribute to the retirement system. It is proposed that this percentage be 5% of the monthly salary since this does not involve a significant reduction in the standard of living. Given that the money contributed by the workers and the institution will be invested in a financial instrument, it is assumed that these instruments will have an approximate interest rate of between 6 and 7% per year (CONSAR 2021). Through convenience sampling, information was collected on the age and seniority of 45 teachers, of which at the time of sampling, 17 were non- unionized and 28 were (the former lacked most of the economic benefits granted by the university). In this way, the sample consists of two mutually exclusive and jointly exhaustive sets (unionized and non-unionized). See the scatter diagram in Fig. 1 for the correlation of the age and seniority of all the teachers in the sample, the non-unionized and the unionized ones. The histograms for the age and seniority of these teachers are shown in Figs. 2 and 3. The raw data can be consulted in the following link: https://tinyurl.com/avahwj5s.

Fig. 1
figure 1

Scatter plot for age versus seniority in the sample (unionized and non-unionized members)

Fig. 2
figure 2

Histograms for faculty age in the sample (unionized and non-unionized members)

Fig. 3
figure 3

Histograms for faculty seniority in the sample (unionized and non-unionized members)

Lastly, as part of the institution’s collective agreement and with the intention to improve faculty salaries, the institution grants a salary increase of approximately 3% per year, which was also included in the model.

4 Conceptual model

According to Law (2000) and others (Rossetti 2021), the conceptual model is a representation of reality, using for example, flowcharts, icons, and assumptions. In our study the savings and retirement process consist of teachers of different ages and salaries who wish to save a percentage of their salary for a retirement fund which, over a period of time determined by them, is increased by the bank interest produced by a trust fund in a banking institution. When the teacher decides to retire, the money collected over the years of savings will be given to him/her so that he/she can enjoy his/her old age (see Fig. 4)

Fig. 4
figure 4

Conceptual model showing the flow of teachers in the different stages during their working life

5 Computational model

In the framework of Arena it is common to start with a pseudo-code previous to make a simulation model using their modules. The pseudo-code Exhibit 1, shows the general model logic.

Exhibit 1 Pseudo-code for the general model

CREATE 1000 faculty with the same initial salary

(D) SUB-MODEL Initial properties and 1 year advance

READ/WRITE a .txt document is generated with initial properties of faculty members

DECIDE after each year, the faculty died (A) o continue in the retirement system (B)

(A) READ/WRITE a txt document is generated with the properties of the faculty which died.

DISPOSE Count the faculty members wich died (involuntary retirement )

(B) ASSIGN different retirement probabilities are assigned to the faculty members

DECIDE if each faculty member is retired (C) or continues working a new year (D)

(C) SUB-MODEL Results storage

DISPOSE of voluntary retirement

A computational model in Arena (Rossetti 2021; Evans and Olson 1998; Fábregas et al. 2003)—shown in Fig. 5—was developed to study the behavior of three output random variables: age, seniority, and savings amount.

Fig. 5
figure 5

Overview of sub-models and main blocks in Arena

To obtain sufficient representativeness in the behavior of the teachers, an entry of 1000 entities was considered, all with the same initial salary.

Through a first sub-model called “initial properties and 1 year change”, the faculty properties will have been assigned. In this sub-model, an Assign block is placed where they are provided with their initial properties, which start with the faculty member’s age. The “Fit Tool” in @RISK (Palisade 2022) was used to fit the best probability distribution to the age and seniority data considering non-unionized faculty members who could enter the pension system (Fig. 6).

Age is modeled with a triangular distribution with a minimum value of 32 years, a mode of 32 years and a maximum value of 78 years. This 32-year-old mode is used as it is the most common age at which workers start within the program. At a significance level of 5%, the Triangular distribution adequately models the years of seniority (as p values are greater than 0.05) and the Akaike statistic is the lowest with respect to the other two best options in the test list (Exponential and Erlang).

Workers have different seniority when starting the retirement program. Seniority is represented by a triangular distribution with a minimum value of 0 years, a mode of 3 years and a maximum value of 40.2 years. At a significance level of 5%, the Triangular distribution adequately models the years of seniority (p values are greater than 0.05) and the Akaike statistic is the lowest with respect to the other two best options in the test list (Pert and Weibull). These characteristics, age, and seniority are stored in an attribute.

Fig. 6
figure 6

Input distributions for age and seniority generated by goodness of fit test in @risk. Top: Age distribution TRI(32,32,78), Bottom: Seniority distribution TRI(2,2,40)

If the worker has an initial salary based on professional status. For this model, an initial monthly salary of MXN 23 181.2 is proposed, which corresponds to an annual salary of MXN 278 174.0. This condition can be modified according to the job type.

Certain attributes, such as the years of seniority within the retirement program (partial seniority) and individual savings that the faculty has obtained, are set to zero when the simulation starts and are updated as the simulation progresses. Two variables are assigned at the end of this module: the salary percentage of contribution to the program, which individually will be 5%, and the institution’s contribution of 5%, combining to be 10%. These properties are shown in Fig. 7.

Fig. 7
figure 7

“Professors assignment” module of initial properties

We use the DELAY module to advance the time 1 year and collect the changes in the attributes. After this change, some variables assigned in the first module are modified, such as age and seniority within the retirement program. These variables are modified, adding a year to each one. Other attributes such as savings will be modified by having 7% per year’s financial institution yields. As part of the institution’s salary increase, the worker’s salary is increased by 3% annually.

As time passes, there is the possibility that teachers will leave the retirement system, so a DECIDE module is used in which it is possible that a quantity of faculty can abandon or remain in the system. A probability of 2% was assigned to leave the system due to unexpected death or because the institution cancels its contract with a worker unexpectedly (involuntary retirement), see Fig. 8. The probability of 2% was obtained from real data of 2019 and coming from the same institution. Next, these workers arrive at a READ/WRITE module where seniority and age are saved in a text file.

Fig. 8
figure 8

Blocks in Arena to represent voluntary retirement

If the faculty does not leave the system with the probability mentioned, then they go to a second sub-model called “probability assignment” (see Exhibit 2 and Fig. 9).

Exhibit 2 Pseudo-code for “probability assignment” submodel

DECIDE

IF condition \((edad\ge 65) \& (AntJub\ge 15)\) is true THEN

send entity TO ASSIGN 1

ELSE IF condition \((edad\ge 65) \& (AntJub\le 15)\) is true THEN

send entity TO ASSIGN 2

ELSE IF condition \((edad\le 65) \& (AntJub\ge 15)\) is true THEN

send entity TO ASSIGN 3

ELSE

send entity TO ASSIGN 4

END IF

ASSIGN 1 : Assigns probability of 95% to retire

GO TO Exit submodel

ASSIGN 2 : Assigns probability of 20% to retire

GO TO Exit submodel

ASSIGN 3 : Assigns probability of 85% to retire

GO TO Exit submodel

ASSIGN 4 : Assigns probability of 15% to retire

GO TO Exit submodel

In this sub-model, there is a DECISION module in which the worker attributes such as seniority and age will be evaluated, and then they receive in ASSIGNS modules a retirement probability value that grows with age and seniority. Within this assignment, the faculty will also receive a “type” of event, according to the range of age and seniority with which they leave the system. If the worker has an age greater than 60 years and their seniority is greater than 25  years, they receive a probability of 95% to retire, since someone meeting these characteristics is unlikely to want to continue working. As another possibility, a faculty member who is older than 60 years but with a seniority fewer than 25 years was assigned a retirement probability of 50%, assuming that if seniority is less to 25 years, it is likely that the faculty will decide to continue working. Another possibility considered in the model is a faculty, less than 60 years old but with a seniority greater than 25 years, to these cases, an 85% probability was assigned that the faculty would retire. Finally, a fourth possibility was considered in which a faculty member is under 60 years and has seniority of fewer than 25 years, in this case, a retirement probability of 2% is assigned. This probability is the lowest since the professor is pre-retirement age and wishes to continue working to continue saving for retirement. The Fig. 10, represents the trajectory in a two-dimensional space of age and seniority where a teacher can be found over time.

Fig. 9
figure 9

Sub-model “probability assignment” for voluntary retirement

Fig. 10
figure 10

Two-dimensional representation of the dynamic evolution of age and seniority

After assigning each faculty member an exit probability, we proceed to a DECISION module in which this probability was evaluated to know whether a faculty member exits the system or remains within it. If the faculty member does not exit, they will immediately be sent to the ADVANCE module that was previously explained. Faculty who exit the system, from the decision module, will enter a third sub-model called “Storage of results” (Fig. 11), whereby mean READ/WRITE and RECORD modules, some attributes will be processed, to gather statistics of seniority, age, and savings.

Fig. 11
figure 11

Sub-model “storage of results” for statistical analysis

Finally, an R program (see appendix I, R Core Team 2022) was developed to graphically represent the distribution of seniority and age frequencies, whose data were generated using the submodel called “Reading results” (Fig. 12)

Fig. 12
figure 12

“Reading results” submodel for reading output information and subsequent analysis in R

6 The life table

A life table shows the distribution of the age-at-death random variable, which is useful in many fields of science. Consequently, a profusion of notation and nomenclature has developed among the various professions using life tables. For example, engineers use life tables to study the reliability of complex mechanical and electronic systems. Biostatisticians use life tables to compare the effectiveness of alternative treatments of serious diseases. Demographers use life tables as tools in population projections.

Life tables are indispensable components of many models in actuarial science. In fact, some scholars fix the date of the beginning of actuarial science as 1693. In that year, Edmund Halley published the life table, called the Breslau table, contained in Halley (1693).

A life table or mortality table is a theoretical model that describes the extinction of a hypothetical or fictitious cohort. It allows to determine the probabilities of surviving or dying at an exact age “x” or between ages “x” and “\(x+n\)”. It is considered to be the most complete tool for the analysis of the mortality of a population at a given time.

According to Welti (1997), the fundamental assumptions for the creation of a life table are:

  • It is a theoretical model that describes, numerically, the extinction process by death of an initial group, generally a cohort of newborns (base of the table).

  • The extinction law corresponds to the mortality experienced by a population during a specific relatively short period of time (usually 1 year).

  • Mortality is posed as a function of age and its patterns are considered constant over time.

Actually, a life table is a cross-sectional analysis, since it is based on the actual mortality pattern observed in the members of a real population. For this reason, it is called a “contemporaneous table”, as opposed to a “generation table”, which is based on a longitudinal analysis of the mortality of a specific generation, from its birth to its complete extinction. In the latter case, a period of at least 100 years is required to conclude the study, which makes it improbable and inefficient. In the contemporaneous table, the mortality patterns for the cohort under study actually correspond to the different generations at the same time, as shown in the Lexis diagram (Fig. 13) for the year 2016.

Fig. 13
figure 13

The Lexis diagram

The diagram can be used to simulate the longitudinal behavior of the 1990 cohort by means of cross-sectional analysis. For example, the deaths of the 1988 cohort occurring in 1990 will represent the deaths of the 1990 cohort occurring in 1992. In the same way, a simulation of the deaths in the remaining cohorts is carried out.

Life tables are characterized by:

  • They allow describing mortality behavior by age and making comparisons by sex.

  • They allow mortality probabilities to be obtained, which are more appropriate than mortality rates for different demographic analyses.

  • They allow the calculation of life expectancy for different ages or age groups. As mentioned in the previous session, this is one of the main summary measures of mortality since it is not affected by the age structure of the population.

  • It can be taken to a theoretical population model, called stationary population, which is achieved by keeping mortality and natality constant over time. In this model, the birth rate is equal to the death rate and the growth rate is 0.

  • They allow diverse applications in a great variety of problems such as: estimation of the level and trend of mortality, evaluation of health programs, fertility and migration studies, socioeconomic studies such as labor force, school population, regulation in retirement systems, etc.

As mentioned above, life tables can be created for single ages or for age groups. When working by age groups, the most common group is the 5-years group; however, due to the strong differences in mortality that occur in the first years of life, it is recommended that the first group be presented individually, especially at age 0.

To construct a mortality table, a series of functions with respect to age must be considered. Each of these functions has many applications within the demographic field, so it is convenient to have a clear understanding of them, as well as their calculation formula and interpretation. In Ortega (2008), the author provides a detailed explanation about this topic.

The Lexis diagram is only a sophistication of this basic diagram, capable of representing not only the duration of the follow-up, but also another time coordinate in which each of the lifelines is immersed. It was invented by a German demographer (Lexis) at the end of the last century, who used it to illustrate the calculation procedures of life tables, it has the virtue of representing two-dimensionally in a simple way, poly dimensional information structures.

It is a diagram of lifelines with two temporal dimensions: calendar time and antiquity or time elapsed since an originating event (if this event is birth, the antiquity is called “age”). Each personal history within a population is marked as a rectilinear segment, which, forming a 45° angle, starts on the baseline (initial event: birth) and ends at some given point in the plane (final event: death).

The dynamics and structure of a given population could be represented in a Lexis diagram, drawing on it all the lifelines of all the individuals that have been part of that population at some point in time. The vertical lines drawn on this theoretical diagram are called moment or contemporary lines and represent a given temporal moment. If we were to carefully count all the lifelines that cross one of these moment lines, we would obtain the population numbers at an exact calendar date “t”. The horizontal lines drawn on this diagram are called anniversary or peer lines and represent an exact age. If we were to carefully count the lifelines that cross one of these anniversary lines, we would obtain the number of individuals that have reached age “x”. The oblique lines at 45° represent the generations or birth cohorts. Between two oblique lines, as shown in the accompanying graph, are the lifelines that make up a generation of individuals.

The vertical and horizontal lines represent the population stock: the vertical lines represent the number of individuals in the population at a given time, and the horizontal lines represent the number of individuals of a generation who have survived to a given age. Population flows are represented as surfaces or areas within this diagram.

The construction process of a life table starts by defining the central mortality rate at age x given by the following expression:

$$\begin{aligned} {}_1m_x \approx \frac{{}_1D_x }{{}_1N_x^{30/VI/Z} } \end{aligned}$$
(1)

where \({}_1m_x^Z\) is the central rate of mortality at age x in year Z (also defined more simply as \(m_x\)).

\({}_1D_x\)is the total number of deaths of people between ages x and \(x+1\) in year Z.

\({}_1N_x^{30/VI/Z}\) is the total number of living people between ages x and \(x+1\) at the middle of year Z (which is on June 30th of year Z).

This demographic information is usually obtained from government census data and is calculated for a specific year Z.

As next step, the probability of death for a person aged x years (\(q_x\)) is calculated in the following way for each possible value of x:

$$\begin{aligned} q_x \approx \frac{2m_x }{2 +m_x } \end{aligned}$$
(2)

Once this probability has been calculated, we obtain the probability that a person aged x years survives one more year (\(p_x\)) as follows:

$$\begin{aligned} p_x = 1-q_x \end{aligned}$$
(3)

In general, the probability that a person aged x years will survive n additional years can be calculated as:

$$\begin{aligned} {}_np_x =(p_{x})\left( p_{x+1}\right) \left( p_{x+2}\right) \cdots \left( p_{x+(n-1)}\right) = 1 - {}_nq_x \end{aligned}$$
(4)

where \({}_n q_x\) represents the probability that a person aged x years will die within the next n years.

An additional step can be taken in order to obtain the mass function for the probability that a person aged x years will survive exactly k years. This is given by:

$$\begin{aligned} f_K(k) = P(K=k) = {}_kq_x = ({}_k p_x) q_{x+k} \end{aligned}$$
(5)

where K represents the random variable known as the “curtate-future-lifetime of (x)”. The interpretation is quite simple as it represents the probability that a person aged x years survives k years more and then dies within the following year (where k is an integer).

Table 1 The life table

Table 1 shows an extract from a spreadsheet of a life table for men. Cell E5 (equal to 0.0018) represents the probability that a man aged 15 years old dies within the year after his 17th birthday (which is between age 17 and 18). This is accomplished by calculating the following:

$$\begin{aligned} {}_2p_{15} \cdot q_{17} = p_{15} \cdot p_{16} \cdot q_{17} = (0.9983) (0.9983) (0.0018)= 0.0018 \end{aligned}$$

In other words, to calculate this probability, we need to determine first the chances that a man aged 15 years old survives 2 years more and then dies between ages 17 and 18.

7 Results

Table 2 shows the confidence intervals with a confidence level of 95% for seniority, saving and age of all teachers, considering 30 replicates in the simulation.

Table 2 Confidence intervals of the variables age, savings, and seniority

To illustrate the output data generated, the frequency distribution (sunflowers and frequency graphs ) for partial seniority, and total seniority versus age for all replications is shown in Fig. 14. The graph of age versus partial seniority shows a shadow area, which indicates a positive correlation between age and seniority. On the other hand, in the graph of total seniority versus age, a large concentration of retirees is observed in the area of age greater than 60 years and seniority greater than 26 years, this is due to the dynamics of retirement proposed in this study. The amount of savings that retirees have according to their characteristics at the time of doing so, according to zones I, II, III, and IV, mentioned previously, are shown in the boxplot of Fig. 15, named type 1, 2, 3, and 4 respectively. Notably highlighting that the oldest and most senior teachers at the time of their retirement are the ones who have saved the most.

Fig. 14
figure 14

Realizations in a two-dimensional space of age-seniority for all teachers who complete their tenure in the retirement system for voluntary reasons

Fig. 15
figure 15

Boxplot for savings according to Fig. 10

To have a better description of the amount saved for older retirees of 60 years and seniority greater than 25 years (previously classified as type 1 teachers), the histogram shown in Fig. 16 was made and corresponds to a sample of 2994 teachers out of 30,000, who were initially assigned the same salary. The histograms corresponding to seniority and age of these same teachers are shown in Fig. 17. For themselves, Table 3 shows their most common statistics. The last stage of this study consisted of forming two subsets of type 1 teachers (called subtypes I and II), to calculate the probability that when their savings are exhausted, they will still be alive. Subtype I correspond to teachers who are 62 years old and have worked for 28 years at the time of their retirement. Subtype II corresponds to teachers who are 62 years old and have worked for 26 years at the time of their retirement. In Table 4, we can see the amount of money saved for each of these teachers. The number of years after retirement in which their savings would be depleted was calculated, and later using the mortality table, determine the probability of still being alive at that time. The interest rate granted by the banking institution where the retiree would place his savings was assumed to be 4% per year and an inflation rate of 3% per year. These results are shown in Table 5.

Fig. 16
figure 16

Histogram for savings of faculty with age older than 60 and seniority more than 25 years (faculty type 1)

Fig. 17
figure 17

Histogram for age and seniority (faculty type 1)

Table 3 Common statistics for selected faculty (faculty type 1)
Table 4 Age, seniority and savings for selected faculty, subtypes I and II, subsets of type 1, at the time of their retirement from the pension system
Table 5 Probability by subtype, subsets of type 1

In the previous work by Montufar et al. (2021), using a deterministic linear programming model, they determined the optimal contribution percentage with respect to the worker’s salary, which guarantees a certain coverage of years of pension enjoyment, after saving a certain number years (see Fig. 18). For example, a point (xy) on curve 0.2 means that a teacher should save and invest at least 20% of his salary for y years so that his money lasts x years of his life to cover his expenses.

The model those authors proposed is like the approach used in this work, in terms of the economic parameters used. For example, saving for 30 years and wanting to have coverage for 15 years, a worker should contribute approximately 17% of his annual salary to the pension fund. Therefore, the results of this study are congruent in the sense of Tables 3, 4, and 5 since teachers who have saved more than 25 years have a high probability that their savings will be depleted before 3 or 4 years of retirement.

Fig. 18
figure 18

Optimal contribution percentage of workers’ wages for the deterministic model mentioned in Montufar et al. (2021). This figure shows the minimum percentages of the salary that a teacher should save during his productive life, to be able to cover his expenses during certain years after retiring

8 Conclusions

Pension models are beneficial for designing strategies that guarantee a dignified retirement for workers. Based on the simulation model developed in this work and its analysis, we can state the following:

  1. 1.

    After obtaining the frequency distribution for partial and full tenure and average savings at retirement, it was shown that these amounts would likely last only 4 years at most after retirement. This was based on a monetary projection of teachers’ annual expenses.

  2. 2.

    This work supports the results of a previous study mentioned in Sect. 7, in which it was stated that teachers should contribute a percentage greater than 17% of their annual salary for 30 years to cover 15 years after their retirement. This strategy is not feasible in Mexico since current salaries for academic professionals are considerably low compared to the current cost of living.

  3. 3.

    In particular, this simulation model incorporates the preferences of academics in terms of age and seniority at the time of seeking retirement. This allows us to predict the behavior of savings and age at the time of retirement. Additionally, we can estimate the life expectancy of a retiree.

  4. 4.

    Future studies of this work can be directed in several ways, such as: incorporating that the probabilities of wanting to retire at a certain age and seniority follow a sigmoidal behavior, instead of the one considered here. It can also be considered that life tables could be obtained in a different way for example, using Gompertz’s law and considering that sometimes the retiree lives with a spouse and the savings must serve to support both during their lifetime.