June 2025. Email.

Content

  • Spanish population up to 2024

  • Age-structured models

  • Matching INE data and age-structured models

  • Female fertility analysis and projections up to 2040

  • Mortality analysis and projections up to 2040

  • Net migration analysis and projections up to 2040

  • Spanish population projections up to 2040

  • Conclusions

  • Bibliography

Evolution of the Spanish population by sex up to 2024

Although more boys than girls are born (in average about 106 boys for every 100 girls), the higher mortality rate among men largely compensates for this in the long term, resulting in a larger women population.

Spanish population pyramid by age between 1971 and 2024

In recent years, the population pyramid has been characterised by a fall in the birth rate (a pyramid shorter base), an increase in life expectancy (a pyramid higher peak) and an increase in net migration (a pyramid greater overall width)

Distribution of the Spanish population by age between 1971 and 2024

Over the years, a shift in the population curve can be observed. The increase in the height of the curve is due to net migration. We can also observe how an anomaly in the curve, which occurred shortly after the Spanish Civil War, shifts over time.

Content

  • Spanish population up to 2024

  • Age-structured models

  • Matching INE data and age-structured models

  • Female fertility analysis and projections up to 2040

  • Mortality analysis and projections up to 2040

  • Net migration analysis and projections up to 2040

  • Spanish population projections up to 2040

  • Conclusions

  • Bibliography

Principles of the age-structured model (Cannan (1895))

  • men/women who are a certain age in a particular year are those who were one year younger the year before and are still alive — plus the contribution from net migration. Deaths are computed using age-specific mortality rate.

  • men/women who are age 0 in a given year are all the boys/girls born the year before who are still alive — computed using a female age-specific fertility rate, the proportion of boys/girls at births, the infant mortality and the contribution of the net migration.

Discrete age-structured model formulation

\[ \left\{ \begin{array} [l]{l} {\small P(a+1,y+1)=P(a,y)-m(a,y)\cdot P(a,y)+M(a,y)}\\ {\small P(0,y+1)=r(1-m(-1,y))\left( \sum_{a}f(a,y)\cdot P_{F}(a,y)\right) +M(-1,y)}% \end{array} \right. \]

  • \({\small P(a,y)}\) : population aged \({\small a}\) in the year \({\small y}\). We consider women and men separately. To simplify the notation, variables without a subscript refer to either men or women. Variables with the subscript “\({\small F}\)” (such as \({\small P_{F}(a,y)}\)) refer to women and variables with a subscript “\({\small M}\)” (like \({\small P_{M}(a,y)}\)) refer to men.

  • \({\small m(a,y)}\) : mortality rate is usually lower in women than in men, i.e. \({\small m_F(a,y)}<{\small m_M(a,y)}\)

  • \({\small M(a,y)}\) : Net migration.

  • \({\small r}\) : Proportion of newborn boys/girls. We use \({\small r_{F}=100/206}\) and \({\small r_{M}=106/206}\).

  • \({\small f(a,y)}\) : fertility rate by age of mother and year.

Leslie matrix formulation (female population)

\[ \left\{ \begin{array} [l]{l} {\small P_F(a+1,y+1)=P_F(a,y)-m_F(a,y)\cdot P_F(a,y)+M_F(a,y)}\\ {\small P_F(0,y+1)=r_F\left( \sum_{a}f_F(a,y)\cdot P_{F}(a,y)\right) (1-m_F(-1,y))+M_F(-1,y)}% \end{array} \right. \]

Assuming that \(\small m_F(a,y)\equiv m_F(a)\) , \(\small f(a,y)\equiv f(a)\) and \(\small M_F(a,y)\equiv M_F(a)\)

\[ \small \underset{\large P_{F}(y+1)}{\underbrace{\left( \begin{array} [c]{c}% P_{F}(0,y+1)\\ P_{F}(1,y+1)\\ P_{F}(2,y+1)\\ . \end{array} \right) }}=\underset{\large \mathbf{L}\text{: Leslie Matrix}}{\underbrace{\left( \begin{array} [c]{cccc}% \hat{f}_{F}(0) & \hat{f}_{F}(1) & \hat{f}_{F}(2) & .\\ s_{F}(0) & 0 & 0 & .\\ 0 & s_{F}(1) & 0 & .\\ . & . & . & . \end{array} \right) }}\underset{\large P_{F}(y)}{\underbrace{\left( \begin{array} [c]{c}% P_{F}(0,y)\\ P_{F}(1,y)\\ P_{F}(2,y)\\ . \end{array} \right) }}+\underset{\large M_{F}}{\underbrace{\left( \begin{array} [c]{c}% M_{F}(-1)\\ M_{F}(0)\\ M_{F}(1)\\ . \end{array} \right) }}% \]

where \(\small s_{F}(a)=1-m_{F}(a)\) and \(\small \hat{f}_{F}(a)=r_F\cdot s_{F}(-1)f_{F}(a)\) .

Leslie matrix formulation

\[\small P_{F}(y+1)=\mathbf{L}P_{F}(y)+M_{F}\]

Leslie matrix formulation (asymptotic state)

\[\small P_{F}(y+n)=\mathbf{L}^nP_{F}(y)+\mathbf{L}^{n-1}M_{F}+\mathbf{L}^{n-2}M_{F}+\ldots+M_{F}\]

Theorem: If there exists 2 consecutive positive values in the first row of the Leslie matrix \(\small \mathbf{L}\) then:

  • \(\small \mathbf{L}\) has a unique positive strictly dominant eigenvalue \(\small \lambda_{max}\) with multiplicity 1 and it has an eigenvector \(\small \mathbf{e}_{max}\) whose entries are all positive.

  • If \(\small P_F(y) \cdot \mathbf{e}_{max}>0\) and \(\small \lambda_{max}>1\) or \(\small M_F\equiv0\), then

\[ \small Lim_{n \rightarrow \infty} \frac{ P_{F}(y+n)}{ \lambda_{max}^n}=K\mathbf{e}_{max}\] for some constant \(\small K>0\).

  • If \(\small \lambda_{max}<1\) and \(\small M_F\neq0\) then

\[ \small Lim_{n \rightarrow \infty} P_{F}(y+n)=(I_d-\mathbf{L})^{-1}M_F\]

Using the last available data for Spain, we obtain \(\small \lambda_{max}=0.982\). Since \(\small \lambda_{max}<1\) (due to the current low fertility rate), the asymptotic state is given by \(\small (I_d-\mathbf{L})^{-1}M_F\). If we consider \(\small M_F \equiv 0\), the population goes to zero and the eigenvector \(\small \mathbf{e}_{max}\) gives the asymptotic age distribution. If, for exmaple, we double the fertility rate \(\small (f(a) \leftarrow 2f(a))\), then \(\small \lambda_{max}=1.002>0\) and the population tends (slowly) to \(\small \infty\) and \(\small \mathbf{e}_{max}\) gives the asymptotic age distribution.

Continuous formulation (McKendrick (1926))

\[ \small \frac{\partial}{\partial a}P(a,y)+\frac{\partial}{\partial y}% P(a,y)=-m(a,y)P(a,y)+M(a,y) \]

This equation can be solved by the method of characteristics. We can also formulate the problem directly on the characteristics for given \(\small a\) and \(\small y\): \[ \small P(t)=P(a+t,y+t),\qquad m(t)=m(a+t,y+t),\qquad M(t)=M(a+t,y+t) \]

\[ \small P(t+\delta t)=P(t)-\delta t\cdot m(t)P(t)+\delta t\cdot M(t) \]

Using a Taylor expansion and passing to the limit when \(\delta t \rightarrow 0^+\)

\[ \small P(t)+\delta t\cdot \frac{dP}{dt}(t)+\mathcal{O}(\delta t^{2})=P(t)-\delta t\cdot m(t)P(t)+\delta t\cdot M(t) \]

\[ \small \frac{dP}{dt}(t)+m(t)P(t)=M(t) \]

\[ \small P(t)=e^{-\int_{0}^{t}m(s)ds}\left( P(0)+\int_{0}^{t}M(w)e^{\int_{0}% ^{w}m(s)ds}dw\right) \]

Variants of the discrete age-structured model

  • Calculation of the number of people who die from an average of \(\small P(a+1,y+1)\) and \(\small P(a,y)\):

\[ \begin{array} [c]{c} {\small P(a+1,y+1)=P(a,y)-m(a,y)\frac{P(a,y)+P(a+1,y+1)}{2}+M(a,y)}\\ \downarrow\\ {\small P(a+1,y+1)=\frac{P(a,y)-0.5\cdot m(a,y) \cdot P(a,y) +M(a,y)}{1+0.5\cdot m(a,y)}} \end{array} \]

  • Calculation of the net migration using an emigration rate \(\small e(a,y)\) and the inmigrants \(\small IM(a,y)\) :

\[ \begin{array} [c]{c} {\small P(a+1,y+1)=P(a,y)-m(a,y)P(a,y)-e(a,y)P(a,y)+IM(a,y)}\\ \end{array} \]

  • Calculation of population by region or nationality (local/foreigners).

Content

  • Spanish population up to 2024

  • Age-structured models

  • Matching INE data and age-structured models

  • Female fertility analysis and projections up to 2040

  • Mortality analysis and projections up to 2040

  • Net migration analysis and projections up to 2040

  • Spanish population projections up to 2040

  • Conclusions

  • Bibliography

Matching INE data and age-structured models

Expected model value for the population

\[{\small \hat P(a,y)=(1-m(a-1,y-1))P(a-1,y-1)+M(a-1,y-1)}\]

Error distribution by year

\[ \begin{array} [c]{c} {\small ERROR(a,y)=100\frac{\hat P(a,y)-P(a,y)}{P(a,y)}} \end{array} \]

Error distribution by age

\[ \begin{array} [c]{c} {\small ERROR(a,y)=100\frac{\hat P(a,y)-P(a,y)}{P(a,y)}} \end{array} \]

Error distribution by sex

\[ \begin{array} [c]{c} {\small ERROR(a,y)=100\frac{\hat P(a,y)-P(a,y)}{P(a,y)}} \end{array} \]

Error analysis of \(\small P(0,y)\) calculated from newborns

Expected model value for \(\small P(0,y)\)

\[ \begin{array} [l]{l} {\small \hat P(0,y)=r(1-m(-1,y-1))\left( \sum_{a}f(a,y-1)\cdot P_{F}(a,y-1)\right) +M(-1,y-1)}% \end{array} \]

Error distribution by sex for \(\small P(0,y)\)

\[ \begin{array} [c]{c} {\small ERROR(0,y)=100\frac{\hat P(0,y)-P(0,y)}{P(0,y)}} \end{array} \]

Content

  • Spanish population up to 2024

  • Age-structured models

  • Matching INE data and age-structured models

  • Female fertility analysis and projections up to 2040

  • Mortality analysis and projections up to 2040

  • Net migration analysis and projections up to 2040

  • Spanish population projections up to 2040

  • Conclusions

  • Bibliography

Total fertility rate

The total fertility rate \(\small TFR(y)= \sum_a f(a,y)\) for a given year is the average number of children per woman over her lifetime, assuming that \(\small f(a,y')=f(a,y) \ \ \forall y'\). The replacement fertility rate to maintain the population level is about \(\small TFR(y)= 2.1\) children per woman.

Distribution of fertility rates by mother’s age between 1975 and 2023

The trend in recent years has been for women to have fewer children and to wait longer before having them.

Fertility rate projection up to 2040

For each mother’s age, \(\small a\), the fertility rate, \(\small f(a,y)\), is projected linearly into the future using a percentage of the current trend given by the slope of a linear regression over the last 10 years. This percentage is a parameter of the model.

Current trend by mother age of the fertility rate.

For each mother’s age, \(\small a\), we show the trend in the fertility rate given by the slope of a regression model approximating \(\small f(a,y)\) by \(\small y\) over the last 10 years.

Total fertility rate up to 2040

Evolution of the total fertility rate \(\small TFR(y)= \sum_a f(a,y)\) up to 2040 according to different trend scenarios.

Average age of mothers by 2040

The average age of mothers is another widely used demographic indicator. Since 1980 there has been a steady increase in this indicator.

Content

  • Spanish population up to 2024

  • Age-structured models

  • Matching INE data and age-structured models

  • Female fertility analysis and projections up to 2040

  • Mortality analysis and projections up to 2040

  • Net migration analysis and projections up to 2040

  • Spanish population projections up to 2040

  • Conclusions

  • Bibliography

Life expectancy at birth

Life expectancy at birth, \(\small LEB(y)= \sum_a a\cdot \text{Pr}(\text{life span} = a)\), for a given year, \(\small y\), is the average number of years a person can be expected to live, assuming that the mortality rate does not change over the years ( \(\small m(a,y')=m(a,y) \ \ \forall y'\)).

Mortality rate by age in 2000 and 2023

The mortality rate \(\small m(a,y)\) is lower for women than for men, it declines over the years and increases exponentially after the age of 65.

Projection of the mortality rate to 2040 (using data up to 2019)

The mortality rate is projected into the future in the same way as the fertility rate. Below we show the result for men and women aged 80. We use data up to 2019 to avoid the influence of the COVID pandemic.

Trend by age and sex of the mortality rate computed up to 2019.

We show, by sex and age \(\small a\), the trend of the mortality rate given by the slope of a regression model approximating \(\small m(a,y)\) by \(\small y\) between 2009 and 2019.

Life expectancy at birth up to 2040

Life expectancy at birth \(\small LEB(y)= \sum_a a\cdot \text{Pr}(\text{life span} = a)\) up to 2040 according to different trend scenarios

Content

  • Spanish population up to 2024

  • Age-structured models

  • Matching INE data and age-structured models

  • Female fertility analysis and projections up to 2040

  • Mortality analysis and projections up to 2040

  • Net migration analysis and projections up to 2040

  • Spanish population projections up to 2040

  • Conclusions

  • Bibliography

Net migration by sex and year

Net migration, \(\small M(a,y)\) , which is the difference between immigration and emigration, is by far the most influential factor in the evolution of the Spanish population. Its evolution is very irregular because it depends on the economic tempo.

Net migration by sex and ages averaged over the last 5 years

The average over the last 5 years of \(\small M(a,y)\), that we name \(\small MT(a)\) (it could be \(\small MT_F(a)\) or \(\small TM_M(a)\)), gives a central value for each age and sex which we consider the current trend of \(\small M(a,y)\)

Projection of the net migration up to 2040

We project \(\small M(a,y)\) into the future in a constant way using a percentage of \(\small MT(a)\). This percentage is a parameter of the model that represents the assumed trend. For example, “0% \(\small MT(a)\)” means that the population is isolated.

Content

  • Spanish population up to 2024

  • Age-structured models

  • Matching INE data and age-structured models

  • Female fertility analysis and projections up to 2040

  • Mortality analysis and projections up to 2040

  • Net migration analysis and projections up to 2040

  • Spanish population projections up to 2040

  • Conclusions

  • Bibliography

Spanish population projections up to 2040

The population projections are calculated using the age-structured model. Trend scenario “50% CURRENT TREND” is assumed for fertility and mortality rates, and several trend scenarios are compared for net migration.

Comparison with the INE projections

To project the net migration, the INE uses a linear interpolation from the value in 2024 to an expected value in 2039. As the 2024 value is about 150% of the 5-year average that we use, the INE projection is initially close to our “150% MT(a)” projection and then it approaches our “100% MT(a)” projection.

Population by age in 2040 under different net migration trends

Comparison of the population by age in 2000, 2024 and 2040

We observe the ageing of the population over the years by comparing the age distribution in 2000, 2024 and 2040 (with the trend in net migration “100% MT(a)”).

Projections of the size of the over-70 population

Between 2024 and 2040, the population aged over 70 will increase by between 46% and 55%. This will represent a huge challenge to Spain’s social and healthcare systems. For instance, an increase of more than 30% in hospital capacity would be required to care properly for the elderly population in 2040.

Content

  • Spanish population up to 2024

  • Age-structured models

  • Matching INE data and age-structured models

  • Female fertility analysis and projections up to 2040

  • Mortality analysis and projections up to 2040

  • Net migration analysis and projections up to 2040

  • Spanish population projections up to 2040

  • Conclusions

  • Bibliography

Conclusions

  • Age-structured models are useful tools for analysing and projecting populations. Such analyses require a combination of mathematical and data processing techniques.

  • In the short and medium term, net migration is by far the most influential factor in the evolution of the Spanish population. However, it is very difficult to forecast due to its strong dependence on the economic ‘tempo’, which can fluctuate irregularly from year to year. Our projections suggest that a reduction in net migration of around 50% would, on average, be required to stabilise the population.

  • In the long term, the fertility rate determines the future shape of the population. With current low fertility rates, even if we maintain net migration of young people, we will have a very ageing population in the future. We need to double the current fertility rate to reach the population replacement rate.

  • The falling birth rate and ageing population constitute major challenges for social and health systems.

Content

  • Spanish population up to 2024

  • Age-structured models

  • Matching INE data and age-structured models

  • Female fertility analysis and projections up to 2040

  • Mortality analysis and projections up to 2040

  • Net migration analysis and projections up to 2040

  • Spanish population projections up to 2040

  • Conclusions

  • Bibliography

[ALVAREZ202502]: Alvarez L., Retos Demográficos en Canarias, Canarias7, 2025.

[AlVi2025]: Alvarez L. and Vicens J.M., El Crecimiento Poblacional en Baleares: Evolución y Retos, Cercle d’Economia de Mallorca, 2025.

[ARIAS2022]: Arias et al., Arias et al., Provisional life expectancy estimates for 2021, Vital Statistics Rapid Release; no 23. Hyattsville, MD: National Center for Health Statistics, Agosto, 2022.

[CANNAN1895]: Cannan Edwind, The Probability of a Cessation of the Growth of Population in England and Wales During the Next Century, The Economic Journal, Vol. 5, No. 20 (Dec., 1895), pp. 505-515

[INE01]: INE, serie 2024-2074, Población residente en España a 1 de enero, por sexo, edad y año, accessed in March 2025.

[INE02]: INE, Tasa de Mortalidad Infantil Neonatal por comunidad autónoma, según sexo, accessed in March 2025.

[INE03]: INE, Tablas de mortalidad por año, sexo, edad y funciones, accessed in March 2025.

[INE04]: INE, Población residente por fecha, sexo y edad (desde 1971), accessed in March 2025.

[INE05]: INE, Flujo de inmigración procedente del extranjero por año, sexo y edad, accessed in March 2025.

[INE06]: INE, Flujo de emigración con destino al extranjero por año, sexo y edad, accessed in March 2025.

[INE07]: INE, Tasas de Fecundidad por comunidad autónoma, según orden del nacimiento y nacionalidad (española/extranjera) y edad de la madre, accessed in March 2025.

[INE08]: INE, Proyecciones de la Población en España 2024-2074, accessed in March 2025.

[KEYFITZ1997]): Keyfitz, B.L. and Keyfitz N., The McKendrick partial differential equation and its uses in epidemiology and population study, Mathematical and Computer Modelling, Volume 26, Issue 6, pp 1-9, 1997

[LUNDQUIST2015]: Lundquist J.H. et al., Demography: The Study of Human Population, Waveland Press, 1015

[MARTINEZ2020] Martinez et al., Incorporating Migration Into an Age-Structured Population Model With Variable Mortality Rate, PUMP Journal of Undergraduate Research, Vol. 3, 2020.

[PRESTON2001]: Samuel H. Preston et al., Demography Measuring and Modeling Population Processes, Blackwell Publishing, 2001.

[STEEL2025]: Steel et al., Changing life expectancy in European countries 1990–2021: a subanalysis of causes and risk factors from the Global Burden of Disease Study 2021, The Lancet Public Health, febrero, 2025.

[WHELPTON1928]: Whelpton Pascal K., Population of the United States, 1925 to 1975, American Journal of Sociology, Vol. 34, No. 2 (Sep., 1928), pp. 253-270

[WILLEKENS1990]: Willekens, F. J., Demographic forecasting. State-of-the-art and research needs, In Emerging issues in demographic research/ ed by C.A. Hazeu and G.A.B. Frinking. (pp. 9-66). Elsevier B.V., 1990.