Predicting of elderly population structure and density by a novel grey fractional-order model with theta residual optimization: a case study of Shanghai City, China

Background Accurately predicting the future development trend of population aging is conducive to accelerating the development of the elderly care industry. This study constructed a combined optimization grey prediction model to predict the structure and density of elderly population. Methods In this paper, a GT-FGM model is proposed, which combines Theta residual optimization with fractional-order accumulation operator. Fractional-order accumulation can effectively weaken the randomness of the original data sequence. Meanwhile, Theta residual optimization can adjust parameter by minimizing the mean absolute error. And the population statistics of Shanghai city from 2006 to 2020 were selected for prediction analysis. By comparing with the other traditional grey prediction methods, three representative error indexes (MAE, MAPE, RMSE) were conducting for error analysis. Results Compared with the FGM model, GM (1,1) model, Verhulst model, Logistic model, SES and other classical prediction methods, the GT-FGM model shows significant forecasting advantages, and its multi-step rolling prediction accuracy is superior to other prediction methods. The results show that the elderly population density in nine districts in Shanghai will exceed 0.5 by 2030, among which Huangpu District has the highest elderly population density, reaching 0.6825. There has been a steady increase in the elderly population over the age of 60. Conclusions The GT-FGM model can improve the prediction accuracy effectively. The elderly population in Shanghai shows a steady growth trend on the whole, and the differences between districts are obvious. The government should build a modern pension industry system according to the aging degree of the population in each region, and promote the balanced development of each region.


Introduction
With the rapid economic development, China's population aging problem has become increasingly prominent.Since China entered an aging society in 1999, the trend of population aging has become more and more significant, which has seriously affected economic development.According to the "Research Report on Predicting Development Trend of China's Population Aging" released in 2006, China will become an irreversible aging society after entering the twenty-first century.Population aging is an important social problem that China is about to face.With the continuous improvement of people's quality of life and medical level, China's population aging problem is becoming more and more serious.China's aging process presents a development trend of large scale, accelerated growth rate, long duration and regional imbalance.Under the background of an aging population, the elderly care industry is developing rapidly, and the scale of social elderly care institutions is also expanding, but it still cannot meet the needs of the elderly population for elderly care institutions.Unbalanced development among regions and uneven distribution of pension infrastructure resources further lead to the spatial imbalance in the distribution of the elderly population.The scientific and reasonable prediction of the development trend of population aging is helpful to provide data and theoretical support for the government to formulate relevant population policies.Predicting the number and density distribution of the elderly population can optimize the allocation of endowment resources, promote balanced development among regions, so as to meet the needs of the elderly population for the elderly and reduce the burden of society.Accurately predicting the structure of the elderly population can better cope with the increasing pressure of the elderly care, and is conducive to promoting the development of the elderly care industry, improving the elderly care service system and improving the infrastructure construction.

Influential factors of aging population
China's aging population is an increasingly serious social problem, which is caused by many factors.Here are some of the main influencing factors: (1) Birth policy.China's family planning policy has been in place since the 1970s to control population growth.While the policy achieved its goals to some extent, it also led to a dramatic drop in fertility.
According to China's National Bureau of Statistics, the total fertility rate in 2019 was 1.69, meaning that each woman had fewer than two children on average.At the same time, with the development of medical technology, people are living longer, leading to an increase in the number of elderly people.(2) Economic development.With the rapid economic development, China's standard of living and social security have been significantly improved.However, at the same time, the cost of living is also rising, which puts increasing pressure on family finances.Many young people believe that giving birth will put too much financial burden on their families, so they are more inclined to choose personal development and career pursuits.In addition, with the improvement of education, more and more women are choosing to pursue career development instead of just focusing on family and children.(3) Urban and rural differences.There are big differences between urban and rural areas in China, as well as different levels of aging.The aging rate is higher in cities than in rural areas because urban families are under greater economic pressure and so tend to have fewer children.Fertility rates are generally higher in rural areas, where the financial burden on families is relatively low and where the traditional belief that having more children increases the family labor force exists.(4) Medical treatment level.As medical technology continues to improve, people are living longer, leading to an increase in the number of elderly people.
The growing number of elderly people not only increases the burden of old-age security, but also brings more challenges to medical and health services, as the elderly are more prone to chronic diseases and need more medical and health service support.
The combined effect of these factors leads to the current situation of China's aging population.The aging trend will bring challenges and opportunities to China's economy, society, politics and other aspects, so it is necessary to take corresponding measures to cope with the impact of aging.

Literature review of prediction models
Population prediction takes the law of population development as the main body to determine the parameters, and the acquisition of relevant data and the selection of prediction algorithm greatly affect the accuracy of prediction results.The existing models used in population prediction research mainly include linear regression model [1], Malthus model [2], Logistic model [3], BP neural network model [4] and Grey prediction model [5].Linear regression model requires population data to change smoothly with obvious linear trend, which is suitable for modeling the relationship between continuous dependent variable and one or more continuous independent variables.Its limitation is that it assumes that the relationship between dependent variable and independent variable is linear, but with the development of economic society, population is difficult to change linearly.Malthus model is a common model of population growth, which assumes exponential growth of population and linear growth of resources.The model is suitable for studying the long-term trend of population growth, but its limitation is that it ignores other factors in the real world, such as technological progress and social policies.Logistic model is suitable for building a model of classification problem.It can divide the population into two or more categories, such as male and female, old and young, etc.Its limitation is that it assumes that the classification decision boundary is linear, so if the data does not conform to this assumption, the accuracy of the model will be affected.BP neural network model is an artificial neural network model, which can deal with nonlinear relations and is suitable for complex problems in population prediction.It can be trained to automatically learn features and predict future population trends.The limitation of this model is that it requires a large amount of training data and is prone to overfitting problems.Grey prediction model is suitable for the prediction of small samples, nonlinear and uncertain problems.It establishes the model through the grey system analysis of the data [6][7][8].However, the model requires data preprocessing, and the prediction results may be affected by the selection of model parameters and data quality.
Grey prediction is a method to predict the system with uncertain factors.It builds mathematical model through "small sample and poor information".Based on the improvement of the traditional grey model, the application range of the grey prediction model is widened.As the core model of grey prediction theory, GM(1,1) model is the most widely used [9].However, the traditional GM(1,1) model is only applicable to the situation of exponential growth of time series and has certain limitations.Many scholars have improved the traditional grey model, and the new models have higher prediction accuracy.Those models are mainly optimized from several aspects: accumulation generation mode, initial value optimization, background value optimization and parameter estimation method.In the process of continuous development, grey system theory has gradually formed a theoretical system centered on grey prediction model, which can be divided into continuous type and discrete type [10], integer order and fractional order [11], linear and nonlinear [12], equal spacing and non-equal spacing [13], etc.In order to reduce the prediction error, Xie et al. built a new discrete grey prediction model (DGM) on the basis of AGO transformation, which can effectively overcome the problem of prediction accuracy [14].The discrete DGM(1,1) model is suitable for predicting small and medium-sized data with discrete characteristics.It has low requirements on the continuity and integrity of data, and has good adaptability to nonlinear and large data differences.Wang introduced nonlinear parameters into the GMC(1,N) model, and obtained an improved grey prediction model (NGMC(1,n)) by means of convolution integral [15].NGMC(1,n) model can solve the problems of nonlinear, non-periodic, non-stationarity and system change, and is suitable for stock price forecasting, seasonal sales forecasting, traffic forecasting and other fields.2))) and optimized the background value [16].INEGM(1,1,t(2)) model is applicable to many fields with seasonal and cyclical changes.Common applications include: flight passenger flow forecast, tourist flow forecast, agricultural product price forecast, power consumption forecast, etc. Wu et al. extended the traditional grey prediction model from integer order to fractional order and proposed a fractional order grey prediction model, which improved the prediction accuracy [17].In this paper, fractional cumulative grey prediction model is adopted as a basic forecasting tool for population aging.The reason is that fractional cumulative model can effectively weaken the randomness of the original data series, and smooth the data series.It can be applied to population data with small sample, stable development trend and short forecasting cycle, which has certain advantages compared with other models.At the same time, fractional order accumulation can reduce the perturbation boundary of the prediction model, satisfy the new information priority principle, and improve the stability of prediction.
With the in-depth research on population aging, many scholars have begun to analyze the distribution of the aging population and the development trend of population aging.Developed countries have entered an aging society earlier than developing countries.European and American scholars have done relevant research on the problem of population aging.By collecting statistical data, Lindh et al. found that changes in the age structure of the population have a negative effect on economic development [18].Tabata used the overlapping generation model to analyze the relationship between population aging and long-term economic growth rate, and found that population aging is not conducive to longterm economic growth [19].Lutz et al. used the age structure of the actual population as a base to predict the total population and population growth rate in future years [20].Grebenkov studied the abnormal growth regular of population aging, and found that the trend of population aging is becoming more and more severe, the number of elderly population has increased sharply, and the demand for elderly medical institutions is also increasing [21].Hashimoto et al. established an iterative model to study the impact of medical demand brought by population aging on employment structure, and the research results show that population aging can promote the improvement of labor turnover rate [22].Zhao et al. established a metabolism GM(1,1) model based on the traditional grey system theory, and tested the predictive performance of the model.The results show that the problem of population aging is still serious and needs active response [23].Su et al. built a combined prediction model of population aging based on three single models: quadratic exponential smoothing prediction, modified grey prediction and BP neural network prediction.The prediction results show that the problem of population aging in China will become more and more serious in the future [24].Sun constructed a combined prediction model for the prediction of the elderly population, and the prediction effect is better than other grey prediction models no matter in the sample or out of the sample [25].Faced with the increasingly serious problem of population aging, all countries should take corresponding measures to reasonably predict the scale of the elderly population and the trend of population aging.

Contribution and innovation
The grey model is a trend extrapolation model based on differential equations, which is mainly suitable for modeling small sample data.For data with nonlinear trends and long-term sequence, the prediction effect of the model is often not ideal, and the prediction error of the model can be adjusted by training samples.Theta predicting is a univariate predicting method that divides the raw data into several component patterns, called " θ lines", and obtains the final predicting results with a controllable curvature parameter [26].Introducing the θ line in the grey predic- tion model to adjust the predicting error can improve the adaptability of the model.Theta prediction method, also known as exponential smoothing method with drift, corrects the local curvature of the time sequence based on the coefficient θ .It can be directly applied to the second- order difference of the data sequence, which is beneficial to improve the prediction accuracy of the model [27].On this basis, the original data sequence is decomposed into nonlinear trend items and linear trend items.The nonlinear trend item emphasizes the short-term characteristics of the data, and the linear trend item emphasizes the long-term characteristics of the data.Fractional accumulation can effectively weaken the randomness of the original data sequence.Considering that the prediction accuracy of the combined model is higher than that of a single model, the Theta residual optimization and the fractional accumulation grey prediction model are combined to improve the prediction accuracy of the model.
The grey prediction model is mainly aimed at the uncertain system of "small samples, poor information", and the population data series is in line with this feature.Therefore, the grey prediction model is combined with Theta residual optimization in this paper.The verification results of the model show that the new model has high prediction accuracy and generalization ability.
The contributions of this paper mainly include the following aspects: (1) The traditional grey prediction model is only applicable to the exponential growth of time series, and has certain limitations.It has become a research trend to improve the traditional grey prediction model.The GT-FGM model proposed in this paper uses fractional order accumulation to effectively weaken the randomness of the original data sequence, which satisfies the new information priority principle to a large extent.At the same time, particle swarm optimization algorithm is used to find the optimal order, so as to achieve better prediction effect.

Organization and framework
The remainder of this paper is organized as follows.
Section 2 provides an overview on traditional grey fractional order accumulation model, and introduces the detailed modeling process of and the Grey Theta fractional order accumulation grey model (GT-FGM) and its error analysis methods, and optimizes the hyperparameters using the particle swarm algorithm.Section 3 introduces the data sources of the total population and the elderly population in Shanghai, and gives the prediction results of the model.In Sect.4, the GT-FGM model is adopted to predict the elderly population structure and density by comparing with other prediction methods.Finally, some conclusions and future work are drawn in Sect. 5.

Methods
In this chapter, the definition of traditional fractionalorder grey model is introduced, and then a Grey Theta fractional-order grey model (GT-FGM) based on residual optimization is established.Furthermore, the detailed modeling process and hyperparameter optimization method are given, and the innovation and improvement of the model are discussed.

Basic model theory
The GM(1,1) model is the basic model of grey prediction theory and is widely used.The model builds a model through systematic behavioral data sequences, and can effectively predict and simulate data in the case of small samples.The GM(1,1) model is based on the grey system theory, through the continuous processing of discrete data, the differential equation is used to replace the difference equation.The new accumulated time sequence is used to replace the original time sequence, and then the differential equation is established [27].The fractional-order GM(1,1) model (FGM(1,1)) converts the first-order cumulative generation in the traditional GM(1,1) model into fractionalorder cumulative generation, and uses the fractional order to effectively weaken the randomness of the original data sequence.It can improve the prediction accuracy of the model and reduce the disturbance of the model solution.
The modeling process is as follows: Step 1: Suppose the sequence of the original data is (1) where stipulating . For the background value generation of X (r) , a sequence close to mean generation is Step 2: The grey differential equation of r-order cumulative GM(1,1) model is Its corresponding whitening differential equation can be expressed as where a is the development coefficient and b is the grey effect.The time response function can be obtained by solving the above differential equation Step 3: Based on the principle of minimum sum of squares of errors, â b can be calculated by the least square method as where, Step 4: Substituting â and b into the equation, the time response function of the original sequence can be obtained as where x(r) (k + 1) is the fitting value at the time of k + 1 , and the sequence is Step 5: The sequence X(r) = {x (r) where, The fitting value of the original data sequence can be obtained as

The modeling process of GT-FGM model
Grey model is mainly suitable for modeling small sample data, and it is based on the trend extrapolation principle of differential equation.However, when the data presents nonlinear relationship and large sample data, the prediction results of the model are often unsatisfactory, and the prediction error can be adjusted by training samples.

Theta prediction skills
Y t is set as the observation sequence, and an θ line Z t (θ) of coefficient θ can be obtained by the following formula Its equivalent form is where Y t is a univariate time sequence, and t is the time point.Z ′′ t (θ) means the second-order difference of the data sequence, {A n , B n } is the intercept and slope of Y t . Then, where Ŷt is the final predicted value, and θ represents the curvature of the predicted curve.In this paper, grey Theta residual optimization is effectively combined with fractional accumulation operator.The randomness of the original data sequence is effectively weakened by fractional accumulation, and a new GT-FGM prediction model is established.
The modeling process is described as follows: Step 1: r-order accumulation generation operation.Suppose that the original time sequence and the r -order accumulated data sequence are respectively then the r-order accumulation operation is performed on the data sequence according to Eq. (1).( 9) Step 2: r-order cumulative discrete equation and parameter estimation.
The discrete equation is used to describe the sequential relationship of the cumulative sequence, which is expressed as Then the result can be obtained by the least square method, The system parameters can be obtained by the following formula: Step 3: Solve time response function and predicted value. Suppose , then according to for- mula ( 16), the time response function of FGM model can be obtained Then, the predicted value X(0) = {x (0) (1), x(0) (2), • • • } is the rorder subtractive sequence of X(r) = {x (r) (1), x(r) (2), • • • } .It can be defined as Step 4: Establish Theta prediction model.Based on the principle of "separation and combination", this paper constructs the nonlinear trend of the original data sequence by introducing θ lines, and can adjust the prediction error by curvature.The specific method is expressed as follows: where x(0) (k) is the long-term trend sequence and xθ (k) represents the nonlinear trend of the local curvature of the time sequence.
X(0) is supposed to be an appropriate long-term linear trend of the original sequence X (0) .θ line is x (r) (3) . . .
} is a simple exponential smoothing sequence of sequence X θ , where Simple exponential smoothing sequence selects parameter α by minimizing the average absolute error.
Step 5: Evaluate the prediction error of the model.Error analysis is an important criterion to judge the accuracy of the model.The model needs to be verified to judge the reliability of prediction before application.In practical application, various methods can be used to analyze the error of the model.The parameter θ is used to adjust the curvature parameters of curves.Unreasonable parameters will produce bad prediction results.In order to evaluate the prediction accuracy of the model, this paper uses three error indicators: mean absolute error (MAE), mean absolute percentage error (MAPE) and root mean square error (RMSE) to evaluate the effectiveness of the model.where x (0) (i) is the observed value, ŷ(i) is the predicted result, and n is the sample size.

Hyperparameter optimization of GT-FGM by particle swarm optimization
The GT-FGM model has two hyperparameters r, θ , and a particle swarm algorithm is used to optimize the hyperparameters.In order to simplify the calculation, the average absolute error within the sample is used to select the appropriate θ .Effective parameter selection can save cal- culation time and reduce prediction error.Therefore, a simple optimization problem is established to express the principle of selecting parameters as follows: (20) x For this kind of nonlinear optimization problem, heuristic algorithm is often more effective than function method.Particle Swarm Optimization (PSO) is a common and easy-to-understand algorithm with low computational complexity.
For the grey prediction model with fractional order accumulation, the order will affect the prediction accuracy of the model to some extent.In order to make the prediction error of the model as small as possible, it is necessary to select the optimal order r .Then the optimal order can be determined by particle swarm optimization.Its basic process is to suppose that there are m particles in D-dimensional space, and the position of each particle represents a possible solution.The position parameter of the i particle is , and the speed parameter is ) , the best position through which it passes is the extreme value of the individual p best .In the whole particle swarm search process, the best searched position is g best .In each iteration, the particle velocity is updated by a single extreme value and a global extreme value.The calculation formula of particle velocity change is where V i+1 represents the updated particle velocity, and w represents the inertia vector.r 1 and r 2 are random numbers varying in the range of [0, 1].c 1 and c 2 are accel- eration constants (usually c 1 = c 2 = 2 ), and v i is limited by the maximum speed v max .
In each iteration, the position of each particle is updated by the position vector and the velocity vector.The formula for determining the position of the particle is where x i+1 is the position of the updated particle.
The modeling process of GT-FGM model is shown in Fig. 1.

Property analysis of GT-FGM
The traditional grey prediction model is sensitive to the initial values, and changes in the initial values in the (26) original data series will not affect the fitted values of the model, and the growth rate of the prediction results will not change.This indicates that the traditional grey model has certain limitations and does not make full use of the new information and the value of information in the residuals.Based on the residual optimization method, we propose the GT-FGM model and use the heuristic algorithm to optimize the hyperparameters of the model, and the proposed model has excellent adaptability.
The innovative nature of the proposed GT-FGM model can be demonstrated by the following properties: (1) The new model has new information priority principle and the new data has a greater effect on the prediction results.
According to Eq. (29) it can be seen that, when r ∈ (0, 1) , the r-order cumulative generating operator satisfies the new information priority principle.In the expression for x (r) (k) , the coefficient of x (0) (i) is larger than x (0) (i − 1) and has greater weight, thus satisfying the new principle of information priority.
(2) The parameter r is used to adjust the data accumula- tion weights of the model.
(29) When r > 1 , the r-order cumulative generating opera- tor satisfies the old information priority principle.In the expression for x (r) (k) , the coefficient of x (0) (i − 1) is larger than x (0) (i) and has greater weight, thus satisfying the old principle of information priority.When r = 1 , a i−1 = a i .In the expression for x (r) (k) , x (0) (i − 1) has the same weight coefficient as x (0) (i).
(3) The model can use θ adaptively to adjust the effect of the fitted and true results on the predicted results.According to Eq. ( 20), it can be seen that the closer θ is to 1, the closer the predicted result is to the true value.(4) The residuals of the grey model are optimized.If the trend of the original data series is not obvious, the simulation performance of the grey model is weak.And in the face of large residuals, Eq. ( 25) can adaptively give a smaller value of θ to avoid higher-than- expected prediction results, which improves the robustness of the model.

Reasons for the selection of Shanghai sample data
According to the data from the National Bureau of Statistics, by the end of 2019, the elderly population aged 65 and above in China was 176.030 million, and the old-age dependency ratio was 17.8%.And by the end of 2020, the elderly population aged 60 and above in China had reached 264.018 million, among which the elderly population aged 65 and above reached 196.635 million.China's population aging is becoming increasingly severe.It is estimated that by 2025, the number of elderly population over 60 years old will reach 300 million, and China will also become a super-aged country [28].According to the predict of the United Nations, by 2050, China's elderly population over 60 years old will account for 35% of the total population, making it the country with the most elderly population.With the improvement of economic level and the prolongation of life expectancy, the elderly population also shows a trend of aging.However, China's population distribution and the degree of aging is uneven between regions.Therefore, it is particularly important to choose typical cases to analyze the problem of population aging.This paper takes the population data of Shanghai as a sample for case analysis, mainly for the following reasons: (1) As a first-tier city in China, the aging problem of Shanghai is more prominent than that of other cities, and the aging population data is more typical.
As a city with high degree of economic development and population density, its population aging has certain particularity.According to data released by the Shanghai municipal government, the city's elderly population aged 65 and above will account for about 22.5 percent of the total population by 2025, and the elderly population is growing at a fast pace, making Shanghai an important city to study the aging problem.(2) The aging of population in Shanghai is higher than the national average level.Shanghai is the earliest city in China to enter the aging society, and also the largest large city with the highest degree of population aging.Shanghai is the economic and financial center of our country.The economy grows faster, and the proportion of elderly population in total population is higher than the national average.According to the National Bureau of Statistics, in 2022, the number of senior citizens aged 60 and above and 65 and above in Shanghai will account for 19.8 percent and 14.9 percent of China's total population, respectively.(3) The data of Shanghai are more comprehensive and reliable.As Shanghai is an international metropolis, data collection, collation and disclosure are relatively standardized and scientific.This also makes the study of the aging problem of Shanghai has a certain representative and reference value.
The relatively comprehensive population data provides abundant information and data basis for the prediction of the elderly population.Shanghai has a perfect data collection system and data release mechanism, and the data quality is high, which provides strong data support for the aging population prediction and analysis.Therefore, Shanghai as a national representative of the aging population problem research, can provide reference and inspiration for other cities.Therefore, as one of the regions with the deepest degree of population aging, the characteristics of the aging population in Shanghai are representative and forwardlooking.It is representative and feasible to choose the population sample data of Shanghai to predict the aging population.The study of Shanghai as a starting point not only has guiding significance for the change trend of Shanghai's industrial structure and relevant policy formulation, but also can serve as a reference for the future population policy formulation.It also helps to actively deal with the problem of population aging and promote the stable development of the aging industry.

Data sources
According to data from the Shanghai Bureau of Statistics, by 2020, there will be 14.756 million people in Shanghai.Among them, there are 1.511 million elderly people aged 60-64 and 3.825 million elderly people aged 65 or above.The aging rate of the population has reached 25.9% (the proportion of people aged 65 or above in the total population).The number of the elderly population in Shanghai is gradually increasing, from 4.360 million in 2015 to 5.335 million in 2020, with an average annual growth of 302,100.The proportion of the elderly in the total population also increased from 30.21% to 36.15%, an annual increase of 1.19 percentage points.It can be seen that the degree of population aging is deepening.The degree of population aging in Shanghai is at a relatively high level in China, which is representative to a certain extent.It is not only the region with the slowest population growth rate in China, but also the region with the most serious population aging.The aging rate of Shanghai is higher than that of other major cities in China, and it is also at a high level compared with international big cities.The aging of population in Shanghai presents the following characteristics: high degree of aging, serious aging phenomenon, aging coefficient increasing year by year, aging rate of registered permanent population is significantly higher than that of the whole city, elderly migrant population shows an increasing trend, and there is a large gap between aging and social development level.This paper takes Shanghai population data as an example to predict and analyze the total population and the number of elderly population in each district of Shanghai.The total population of each district in Shanghai from 2006 to 2020 is used, and the data source is the "Shanghai Statistical Yearbook 2021" [29].The population data of the 16 districts in Shanghai is shown in Table 1.
From the bar chart, we can intuitively see the population of each district in Shanghai from 2006 to 2020 (as shown in Fig. 2), and the total population generally shows a slight upward trend.Among them, the population of Huangpu, Changning, Jing'an, and Hongkou District showed a downward trend.The population of Xuhui, Putuo, Yangpu, Jinshan, Qingpu, Fengxian, and Chongming District changed steadily, and the fluctuation is not large, while the five districts of Minhang, Baoshan, Jiading, Pudongxin and Songjiang District show an upward trend year by year.
The statistics of the elderly population over 60 years old in each district of Shanghai are shown in Table 2.The number of the elderly population in each district is increasing, and the trend of population aging is also more obvious.
From the bar chart, we can intuitively see the number of elderly population in each district in Shanghai from 2006 to 2020 (as shown in Fig. 3), and the total number of elderly population in each district shows an increasing trend year by year.
The basic age structure distribution of the elderly population in Shanghai is shown in Table 3, which includes the data of the elderly population in the three age groups of 60-69 years old, 70-79 years old and over 80 years old.

Population prediction
In order to verify the validity of the model, the total population of each district in Shanghai is selected as an example.Jing'an District is one of the districts with the highest degree of aging population in Shanghai, and it is the earliest urban area in Shanghai to enter deep aging.The total population of Jing'an District shows the trend of decreasing year by year.By the end of 2020, the region has a registered population of 905,300, among which 362,900 are aged 60 or above, accounting for 40.1% of the region's total registered population, indicating a serious aging population.As the only pilot area in Shanghai for the first batch of homebased and community-based basic elderly care Service Improvement action project, Jing'an District is representative to some extent.Firstly, taking the population prediction of Jing'an District as an example, taking the population of Jing'an District from 2006 to 2020 as a sample, and the GT-FGM model is established to predict the total population of Jing'an District from 2021 to 2030.The modeling process of Jing'an District's population prediction is as follows: Step 1: The original sequence of the total population of Jing'an District is The PSO algorithm is used to find the optimal order r , which makes the error of the model minimum.The calculation results show that the order 0.9491 is the optimal order.The model error is the smallest under this order, which is 0.30%, and the prediction result is more accurate.The 0.9491th order accumulation sequence is X (0.9491) = {x (0.9491) (1), x (0.9491) (2), x (0.9491) (3), x (0.9491) (4), x (0.9491) (5), x (0.9491) (6), x (0.9491) (7), x (0.9491) (8), x (0.9491) (9), x (0.9491) (10)x (0.9491) (11), x (0.9491) (12), x (0.9491) (13)x (0.9491) (14) Step 2: The values of unknown parameters β 1 , β 2 can be obtained by the following formula Then, Step 3: The time response function is The above formula can be obtained The 0.0509-order accumulation of the sequence X(0.9491) can obtain the predicted value X(1) of the 1-order accumu- lation of the original sequence as follows Then, X(1) is restored, and the predicted value of the original data is Step 4: The optimal parameter θ is obtained by particle swarm optimization, and θ best = 5 .Then Step 5: Use the average absolute error within the sample to select the appropriate θ .The optimization problem is as follows:  4.
As can be seen from Table 4, the prediction results of the five models have good performance and high prediction accuracy.The fitting error of Verhulst model is relatively small, while the prediction error of GT-FGM model is smaller than that of FGM model, GM(1,1) model, Verhulst model and SES.The average absolute percentage errors of  the five models are all significantly lower than 10%, while the predicted MAPE value of GT-FGM model is 1.63%, which also indicates that this model has high multi-step prediction accuracy and can effectively predict the future trend of Shanghai population.The prediction trend curves of five different comparison models for the total population of Jing'an District is shown in Fig. 4. It is obvious that GT-FGM model has obvious overall advantages over other comparison models in both the fitting area and the testing area, especially reflecting the stable and reliable multi-step prediction ability.
The exact criteria of MAPE value are shown in Table 5, from which it can be judged whether the prediction error is accepted or not.When the MAPE value is less than 10%, the prediction performance of the model is excellent, indicating that the prediction accuracy of the model is high and the error is relatively small.The MAPE value of the predicted results in Jing'an District is only 1.63%, and the prediction error of the model is small.Therefore, the GT-FGM model has better predict performance.
From the predicted results of Jing'an District, it can be seen that the GT-FGM model proposed in this paper has a small predict error and a relatively good predict effect.It can be used to predict the population of various districts in Shanghai from 2021 to 2030.The predicted results are shown in Table 6.
As can be seen from Table 6, the population of Shanghai shows a steady growth trend.It is estimated that the  total population of Shanghai will reach 15,718,300 by 2030.Among them, the population of Huangpu, Changning, Jing'an, Putuo, Hongkou, Yangpu and Chongming Districts showed a slight downward trend, while that of Xuhui, Minhang, Baoshan, Jiading, Pudongxin, Jinshan, Songjiang, Qingpu and Fengxian Districts showed an upward trend year by year.Xuhui, Changning, Putuo and Chongming Districts have not changed much in general.
According to the predicted results, by 2030, the population of each district will be 665,500 in Huangpu, 936,800 in Xuhui, 560,800 in Changning, 814,700 in Jing'an, 890,800 in Putuo, 634,000 in Hongkou, 1,030,900 in Yangpu, 1,415,000 in Minhang,1155,200 in Baoshan, 942,300 in Jiading, 3,458,400 people in Pudongxin, 548,500 in Jinshan, 765,400 in Songjiang, 642,100 in Qingpu, 582,500 in Fengxian and 675,400 in Chongming.The predicted results of the total population of each district in Shanghai are shown in Fig. 5.

Predict the number and density of the elderly population
Based on the prediction of the total population of all districts in Shanghai, it is found that GT-FGM model has a relatively good prediction effect.Next, taking the total number of elderly population in Shanghai as an example, and comparing it with FGM model, GM(1,1) model, Verhulst model, Logistic model and SES, then test the prediction effect of the model.The prediction results of GM(1,1) model basically accord with the trend of exponential growth, but for complex nonlinear data sequence, its prediction effect is often not ideal.FGM model is the   Therefore, it can be seen that the test results of GT-FGM model are more in line with the real data and can effectively predict the number of elderly population in Shanghai.The comparison of the prediction results of the total elderly population in Shanghai under the six models is shown in Fig. 6.Therefore, GT-FGM model can be used to predict the data of the elderly population in various districts of Shanghai, compared with FGM model, GM(1,1) model, Verhulst model, Logistic model and SES, and the prediction accuracy of the model can be tested with the help of three error indicators: MAE, MAPE and RMSE.Taking Jing'an District as an example, the prediction results of the elderly population are shown in Table 7.
As can be seen from Table 7, the fitting and prediction error indexes of the six comparison models are all small.The fitting error of the FGM model is the smallest, while the prediction error of the GT-FGM model is the smallest, and its MAPE value reaches 1.44%, indicating that the multi-step prediction effect of the GT-FGM model is relatively optimal.The results show that the GT-FGM model has high prediction accuracy and can effectively predict the number of elderly population in Shanghai.
Next, the elderly population prediction of Xuhui District is also taken as an example for verification.The prediction results of the six comparison models are shown in Table 8.
Similar to the fitting and prediction results of Jing'an District, the fitting errors of FGM model and Verhulst model are relatively small, while the multi-step prediction errors of GT-FGM model are relatively minimal.The MAPE value of GT-FGM model is as low as 1.32%, indicating that the prediction effect of this model is relatively optimal.
Next, taking the number of elderly population in each district of Shanghai from 2006 to 2020 as the original data sequence, and adopting the same modeling steps as above, the predicted number of elderly population in each district of Shanghai from 2021 to 2030 is obtained, as shown in Table 9.
As can be seen from Table 9, the number of elderly population in all districts of Shanghai is increasing continuously.It is estimated that the total number of elderly population in Shanghai will reach 7,391,000 by 2030, while the number of elderly population in Pudongxin District is the largest, reaching 1,358,900.The predicted total number of elderly population in all districts of Shanghai shows a gradual growth trend, as shown in Fig. 7.
According to the above-mentioned total population and the number of elderly population in various districts of Shanghai from 2021 to 2030, the density of elderly population in various districts of Shanghai can be obtained, as shown in Table 10.
It can be seen from Table 10 that the elderly population density in Huangpu District of Shanghai will be the highest by 2030, reaching 0.6825, while that in Qingpu District will be the lowest, reaching 0.3543.It is predicted that the elderly population density in nine districts of Shanghai will exceed 0.5, including Huangpu, Xuhui, Changning, Jing'an, Putuo, Hongkou, Yangpu, Baoshan and Chongming Districts.Through the map marking method [30], the distribution of the elderly population density in Shanghai in 2030 was drawn, as shown in Fig. 8.

Predicting the age structure of the elderly population
Next, the GT-FGM model is used to predict the basic situation of the age structure of the elderly population in Shanghai.The prediction results of the elderly population of all ages in Shanghai from 2021 to 2030, as shown in Table 11.
As can be seen from Table 11, the number of elderly population over 60 years old has increased steadily on the whole.The elderly population aged 60-69 and 70-79 increase by 80,000 and 120,000 each year on average, with a fast growth rate, while the elderly population aged 80 and above increases by 4,000 each year, with a relatively slow growth rate.The growth trend of the age structure of the elderly population in Shanghai, as shown in Fig. 9.

Conclusions and future work
The population problem has been affecting China's economic development, and the process of population aging is also accelerating, which is an important social problem currently facing.Accurately predicting the number of the elderly population is conducive to the formulation of relevant government policies and the positive development of the economy and society.In this paper, the GT-FGM grey prediction model is proposed, which makes use of the advantage of fractional accumulation operator that can effectively weaken the randomness of original data sequence, and combines the advantages of Theta residual optimization that can adjust the local curvature of time sequence by parameters and minimize errors to adjust parameters.The error comparison results in case analysis show that GT-FGM model has a superior prediction effect in population prediction.

Conclusions and suggestions
The prediction results of Shanghai show that the number of elderly population in each district of Shanghai presents a trend of steady growth and obvious aging trend during 2020-2030.As the scale of the elderly population is constantly expanding, the degree of population aging is further deepening.Compared with traditional prediction models such as FGM model and GM(1,1) model, the prediction error of GT-FGM model is smaller, and its prediction accuracy is better than other prediction models.By 2030, the total elderly population in Shanghai will reach 15.2420 million, and the elderly population density in nine districts will exceed 0.5, among which Huangpu District is the highest, reaching 0.6825.The number of elderly people over the age of 60 has been steadily increasing, with the number of people aged 60 to 69, 70 to 79, 80 and above increasing by an average of 80,000, 120,000 and 4,000 each year.The difference of density distribution between regions is great, which is not conducive to the development of economy and society.
According to the prediction results, the following suggestions are present: (1) Improving the pension security system.It is suggested to increase the investment in the construction of pension infrastructure, so as to alleviate the social pressure brought by the aging population, and provide the elderly with pension insurance, medical insurance and other pension security systems to meet the needs of the elderly.
(2) Reforming the medical and health care system.It is suggested to optimize the allocation of endowment and medical resources, improve the social medical security system, make medical treatment more convenient for the elderly, reform the medical security system, so that the elderly can fully enjoy the benefits of improved medical conditions.(3) Promoting balanced development among regions.
According to the degree of population aging in different regions, it is suggested to formulate reasonable population policies to optimize the population age structure.(4) Developing the aging industry.It is suggested to adjust the pension policy in time according to the actual situation, develop the pension market, promote the development of the pension industry, better serve the elderly and meet their life needs.(5) Delaying the retirement age.It is suggested to reform the retirement system, raise the statutory retirement age, ease the social pressure brought about by an aging population, and allow the elderly to continue to play their role in work.This model can be applied to the research of gerontology, to predict the number and density distribution of the elderly population, and to analyze the development trend of population aging.

Future work
Since the prediction algorithm of univariate time series is established in this paper, the relevant influencing factors are not used for prediction analysis.The main reasons include the following: (1) The development of population data is restricted by birth rate, socio-economic development, family planning policy, two-child policy and other factors, and its data characteristics have not been fully explained.It is difficult to consider all influencing factors in the model, and the complexity and diversity of population behavior make relevant factors unable to be accurately captured or explained.(2) Population aging tends to show an accelerated growth trend, and the historical statistical data information value is low, and the reliability of the model is poor.Therefore, when the actual situation changes, the prediction results of the model may lose accuracy.In addition, the structure of the model itself may lead to inflexibility of the forecast results, even when the variable factors are taken into account.(3) Currently available population data information is limited, and there is great uncertainty in the future population development.Problems such as incompatibility between different data sources and lack of temporal and spatial coverage of data will affect data quality, thus affecting the prediction results of the model.(4) If a multivariate model is constructed considering a variety of influencing factors, it usually needs to be built on some theoretical framework, but the theory itself may have defects.In addition, the selection of model structure, the setting of variables and other factors may lead to the limitations of model prediction.For example, some important variables are ignored during model construction, which may lead to inaccurate model prediction results.
Therefore, it is necessary to comprehensively consider the limitations and reliability of the model in the aspects of model establishment, parameter selection, data source and so on when making prediction analysis of population problems.At the same time, combined with the actual situation and other methods to comprehensively analyze the population problem.In the future, how to make full use of the family planning policy, two-child policy and other influencing factors, consider the use of multivariate model to fit and predict the problem of population aging, this issue will become the direction of further research and in-depth thinking.

Fig. 1
Fig. 1 Modeling flow chart of GT-FGM model

( 4 )
Compared with other areas in China, the distribution of the elderly population in Shanghai is relatively balanced, which can represent the general situation of the elderly population in China.The population distribution is more concentrated, and the sample data is more representative, which can accurately reflect the changing trend of the elderly population.At the same time, Shanghai has accumulated certain research experience and achievements in the aging problem research.Shanghai Municipal government and research institutions have carried out a series of researches and practices on the aging problem, and the achievements can provide important reference and reference.

Fig. 2
Fig. 2 The total population of each district in Shanghai from 2006 to 2020

Fig. 3
Fig. 3 The total number of elderly population in each district of Shanghai from 2006 to 2020

Fig. 4
Fig. 4 Comparison of the predicted results of the total population in Jing'an District under five models

Fig. 6
Fig. 6 Comparison of the predicted results of the total elderly population in Shanghai under six models

Fig. 8
Fig. 8 Density distribution of elderly population in Shanghai in 2030

Table 1
The permanent resident population in Shanghai's districts from 2006 to 2020 (Unit: 10 4 people)

Table 2
The number of elderly population in each district of Shanghai from 2006 to 2020 (unit: 10 4 people)

Table 3
Distribution of age structure of the elderly population in Shanghai from 2006 to 2020 (unit: 10 4 people)

Table 4
Comparison of population prediction of Jing'an District under five models (unit: 10 4 people) Data in boldface highlights the prediction errors of the corresponding prediction model is minimal

Table 6
Predicted population of Shanghai from 2021 to 2030 (unit: 10 4 people) Predicted results of total population in various districts of Shanghai optimized form of GM(1,1) model, but from the test data, the prediction error is greater than GT-FGM model.Verhulst model and SES are both time series prediction models.Verhulst model is a nonlinear model based on Logistic growth model, which is suitable for time series data with S-shaped growth trend.For data series with nonlinear growth trend, the model has a better prediction effect.SES is a kind of exponential smoothing model, which is suitable for time series data with relatively stable growth trend.From the comparative analysis of the test data, the overall prediction performance of the GT-FGM model is relatively better.

Table 7
Predicted results of elderly population in Jing'an District under six models (unit: 10 4 people) Data in boldface highlights the prediction errors of the corresponding prediction model is minimal

Table 8
Predicted results of elderly population in Xuhui District under six models (unit: 10 4 people) Data in boldface highlights the prediction errors of the corresponding prediction model is minimal

Table 9
Predicted number of elderly population in Shanghai from 2021 to 2030 (unit: 10 4 people)

Table 10
Predicted values of elderly population density in Shanghai from 2021 to 2030 (unit: %)