# Demand Forecasting Model for Airline Flights Based on Historical Passenger Flow Data
## 2 Materials and Methods
### Algorithm for Medium-Term Flight Demand Forecasting
The presented algorithm forms the foundation of the developed model, where it is proposed that each of the described blocks will be implemented within the model. Figure 1: Three-stage algorithm for medium-term flight demand forecasting. The following section will present the mathematical models and tools that are necessary for the implementation of each of the aforementioned model development steps. Time-series models are used to construct medium-term forecasts of air travel demand based on historical data. Such models employ a univariate time series approach, whereby future values are predicted based on past observations. These observations are discrete and occur at equal time intervals. In the context of constructing the demand distribution, observations can be classified as discrete, with a unit of measurement of one hour [16; 34]. This study employs the open-source forecasting package Facebook Prophet for time series modeling and the estimation of demand trends. This package is an additive linear model that combines several components to identify different patterns in the data, including trends, seasonality, holidays, and other relevant features [35; 36]. The model is expressed by the following relationship (see Equation (7)):  
\[y(t)\ =\ g(t)+s(t)+h(t)+\xi(t), \tag{7}\]  
where \(g(t)\) is a piecewise linear or logistic growth curve for modeling non-periodic changes in the time series, \(s(t)\) is a function responsible for modeling periodic changes associated with hourly, daily, weekly, and annual seasonality, \(h(t)\) is a function responsible for accounting for the impact of irregular holidays and user-defined events, \(\xi(t)\) is an error function employed to account for any changes that were not accounted for by the model. Furthermore, the model can incorporate a multiplicative function to illustrate an exponential trend, whereby the seasonal effect is multiplicative to the trend. This methodology permits the discrepancy between actual and predicted values to be distributed uniformly across the years, thereby enhancing the precision of the forecast. The general equation then assumes the following form [37] (see Equation (8)):  
\[\hat{y}(t)\ =\ g(t)*(1+mult.term)+add.term, \tag{8}\]  
where \(g(t)\) is a piecewise linear or logistic growth curve for modeling non-periodic changes in time series, _mult.term_ is the multiplicative component (usually used to model changes that are proportional to the current level of the time series), _add.term_ is the additive component. The Prophet model is used as part of machine learning and enables analysis of historical airline passenger demand data in order to identify dependencies and data features and significant statistical characteristics and to model periodic changes associated with weekly and annual seasonality [38]. The method is an efficient means of handling data containing seasonal impacts and is also capable of producing robust forecasts in the face of missing data and emissions. This is a particularly important attribute when analyzing flight demand [36; 37]. It can be demonstrated that the utilization of the Prophet package will facilitate the replication of the continuation of the univariate time series of the value of demand for airline flights in the medium term. In order to analyze the influence of external factors and model their relationship with the demand outcome, the construction of multiple regression models is proposed [39; 40]. In order to ascertain the external economic factors influencing demand, GRP (gross regional product), median per capita income, and population size were selected for analysis. Data on the macroeconomic factors previously outlined should be collected in relation to the departure and arrival airport regions of the analyzed route network [9; 41]. The objective of constructing a multiple regression model is to identify the coefficients of influence exerted by macroeconomic factors on passenger demand. This is achieved by employing historical data on demand and the dynamics of changes in the aforementioned factors.