1 Introduction

As China's economy has rapidly developed, urban areas have continuously expanded, leading to increases in the urban population and the number of motor vehicles. Since the twenty-first century, with continuous improvements in the living standards of urban residents in China, private cars have become the preferred choice of transportation. This choice has resulted in increasingly severe congestion on highways, leading to a decline in highway efficiency. In addition, factors such as poor driving habits have exacerbated the issue of highway congestion [1]. Traffic congestion, long durations of congestion, and complex traffic characteristics are often observed on highways due to the intertwined movement of vehicles.

Highways play a crucial role in promoting efficient interactions and facilitating resource sharing among cities. These roadways serve as essential infrastructures for improving the transportation environment and driving economic development and act as lifelines for disaster relief and emergency response. Therefore, in recent years, through the analysis of traffic flow data, traffic flow instability and congestion have been observed, significantly reducing the efficiency of traffic operations. Consequently, one effective approach to address these problems is the development of intelligent transportation systems. Traffic flow prediction is not only a primary function in achieving intelligent transportation systems (ITS) [2] but also an important means to realize the transformation of highway construction from traditional road infrastructure to intelligent services. Short-term traffic flow prediction aims to intelligently and systematically forecast changes in traffic flow on highways by mining the patterns of traffic flow variations and anticipating the state changes of transportation systems. These predictions enable a more accurate and timely prediction of traffic flow changes on highways, facilitating the advancement of intelligent and systematized transportation information systems. Specifically, short-term traffic flow prediction involves predicting changes in traffic flow on a particular road within the next few minutes or hours. Real-time accurate traffic flow prediction can provide a decision-making basis for traffic management departments to develop programs and transform passive processing to active prevention, thereby supporting active traffic management and control. Thus, scientific and reasonable emergency programs and effective control measures should be developed to ensure safe and rapid travel on highways and reduce time and economic losses.

To promote the development of intelligent highways, research on related traffic flow prediction is constantly evolving, and experience is constantly being gained in terms of problem-solving approaches and methods. For example, statistical models, including historical mean models [3], time series models [4], and Kalman filter prediction models [5] have been utilized. Among them, historical mean models and time series models are also linear models. Historical mean models make predictions based on average historical data values before a set prediction point, while Kalman filter prediction models utilize the state space value at the previous moment to make predictions; both of these types of models are suitable for stationary data with small fluctuations, and they have the advantages of being noncomplex with an easy programming implementation and simple calculations. However, these methods may not be able to predict data changes characterized by the nonlinearity and randomness of traffic flow well, and such models satisfy real-time requirements. The autoregressive integrated moving average (ARIMA) model [6] is a commonly used time series forecasting method. This type of model has the advantages of fast computation speed and can be constructed using only the data of a variable itself. However, this model has certain data requirements. With the development of science and technology, the advantages of the ARIMA method have weakened.

In addition, artificial intelligence technology has been introduced to address the shortcomings of traditional statistical models. Currently, mainstream models include machine learning models [7] and deep learning models [8]. In commonly used machine learning models [9, 10], such as the support vector regression (SVR) and K-nearest neighbor (KNN) models, the parameters are continuously adjusted to capture complex nonlinear relationships through adaptive learning. The support vector regression and K-nearest neighbors models can be used for small-scale datasets or time series. The K-nearest neighbor algorithm is simple, easy to understand and implement, and can be used for nonlinear classification with high accuracy. Support vector regression can solve nonlinear problems and has strong generalizability and robustness, but there is no universal method for selecting kernel functions. In general, prediction methods based on machine learning can solve the poor performance problems of traditional methods and can also address nonlinear problems; however, to achieve high accuracy, a large amount of training data is generally required.

Deep learning, which has been rapidly developing in recent years, is a major research direction in the field of machine learning. There are a wide range of deep learning models, such as recurrent neural networks (RNN) [11], long short-term memory (LSTM) networks [12], and convolutional neural networks (CNN) [13]. LSTM and Bi-LSTM are successful variants of RNNs that have been extensively studied, and impressive progress has been made using these variants [14, 15]. These methods have gained significant popularity among researchers and have yielded remarkable results. Zhang et al. [16] proposed and evaluated a new advanced model, the long short-term memory (LSTM) model, based on transfer learning for traffic flow prediction with incomplete traffic information. To improve the accuracy of short-term traffic flow prediction, Naheliya et al. [17] proposed a bidirectional long short-term memory (Bi-LSTM) model with a modified firefly optimization algorithm (MFOA) named MFOA-Bi-LSTM. To predict short-term traffic flow, Bharti et al. [18] developed a PSO-Bi-LSTM model based on a combination of particle swarm optimization (PSO) and bidirectional long short-term memory (Bi-LSTM) neural networks. Typically, deep learning algorithms require more training time because they have many parameters that must be trained on a large amount of data. In addition, complex predictive techniques are not necessarily superior to simple predictive techniques because complex predictive techniques may easily fall into local optima, leading to overfitting problems, and require a large amount of information to derive parameters, especially when faced with limited and insufficient data.

The grey prediction model can partially compensate for the shortcomings of the above models. The grey system theory proposed by Deng (1982) is in line with the characteristics of limited information and significant uncertainty in traffic flow data [19]. Additionally, short-term traffic flow prediction involves inferring future traffic conditions by obtaining a certain amount of dynamic data on road traffic flow. Therefore, the most prominent advantage of the grey prediction model over traditional statistical prediction methods and artificial intelligence learning methods is that it can still achieve accurate predictions when limited data are available and can better handle sudden changes in real traffic flow [20].

The grey prediction model has potential applications in various fields, such as natural gas [21, 22], nuclear energy [23, 24], electricity [25, 26], solar energy [27], and others [28]. These endeavors have to some extent confirmed the modelling capacity of the grey prediction model. For example, Chen et al. [29] proposed a grey model with a fractional Hausdorff derivative to improve the prediction accuracy of traditional grey models and demonstrated the relationship between error and order. The experimental results showed that the proposed model can improve upon traditional grey models. Chu et al. [30] introduced the Jensen-Shannon divergence to measure the differences between discrete Z numbers based on Z theory and grey relationship theory, reducing the complexity of Z number calculations. The authors established a quantitative model of the grey correlation degree based on discrete Z numbers and proposed a multidimensional fuzzy grey multicriteria optimization decision-making method for evaluating the benefit of using Arctic routes. To investigate the modelling performance of fractional accumulated generation operations, He et al. [31] proposed an enhanced fractional accumulation grey model (AFAGM) by studying the relationship between restoration error and order. Through case analysis and comparative verification, the model achieved excellent predictive performance and high modelling efficiency.

Several scholars improved upon the method in the data preprocessing stage and model construction stage and achieved better prediction results. Duan et al. [32] applied mechanical performance to traffic flow data, proposed four new structural parameter models and component parameters and analyzed the properties of the models. To overcome the effect of instability on the model, Duan et al. [33] preprocessed lost flow and anomaly data to predict short-term traffic flow, which improved the model's ability to process complete traffic flow data. Methods to improve the model construction stage include cumulative generation operator changes, parameter optimization and residual correction. Liu et al. [34] proposed a damping cumulative generation operator that is superior to the traditional first-order cumulative generation operator and constructed an improved grey prediction model with a damping trend factor. Since traffic flow has spatiotemporal characteristics and periodicity, Duan et al. [35] employed partial differential equations to effectively capture the spatiotemporal attributes of traffic flow, replacing point sequences with matrix sequences and average sequence partial derivatives to establish a partial grey prediction model with a control matrix, which provides a new idea for research on traffic flow prediction. In the literature, related studies also cover improved methods of different forms of models. To improve the performance of the GM(1,1) model in estimating various traffic parameters in a short period, Comert et al. [36] combined the oscillatory behavior characteristics of sine and cosine functions, extended trigonometric functions and verified that this type of grey model can better handle sudden changes in traffic flow. To study the stop-and-go phenomenon caused by car-following, Wen et al. [37] first added Brownian noise to the velocity difference of the car-following model and subsequently modified the car-following model by introducing a traffic flow model fused with the car-following model.

Existing models have not yet demonstrated sufficient ability to accurately capture the dynamic nature of traffic flow systems. Typically, these models are usually first-order constant coefficient differential models that limit the range of values of order to a certain extent, resulting in a decrease in the stability of the model's performance under different conditions. The Euler equation is a higher-order differential equation of variable coefficient equations that can capture the characteristics of system changes over time and has better flexibility and interpretability. Therefore, in this study, the Euler equation of traffic flow is described, and high-order differential equations with variable coefficients are investigated, leading to the establishment of a grey prediction model for high-order Euler equations using grey differential information. The new model is a parameter-adjustable and structurally variable high-order grey model. Moreover, considering the uncertainty of the order of the Euler equation, to maintain the stability of the model, a linear correction term is introduced into the constructed model to prevent data overfitting from occurring, and parameter ranges are set. The particle swarm optimization algorithm is used to optimize the order of the new model, improving the model's accuracy. The primary contributions of this paper can be summarized as follows:

  1. (1)

    In terms of the model structure, to enhance the accuracy of traffic flow prediction, this study proposes a novel model with a structure derived from Euler equations in fluid mechanics. This model has variable order and structure, increasing its flexibility. The introduction of Euler equations with variable coefficient differentiation enhances the ability of the model to adapt to complex data. The coefficients are set as variables related to time, offering a more accurate representation of the dynamics of traffic flow over time and thus leading to better flexibility and explanatory ability. The linear correction term is introduced into the grey role quantity term, which enhances the model structure stability.

  2. (2)

    In terms of the research methodology, a high-order variable coefficient grey prediction model is constructed based on the Euler equations by using the principle of grey differential information, and the new model is studied in terms of parameter estimation using the least squares method. Mathematical methods such as recursive sequences and mathematical transformations are employed to solve the model, and the time response function of the model is derived in detail, culminating in the final expression. To optimize and improve the accuracy of the new model, the particle swarm optimization algorithm is employed, which results in better flexibility and interpretability.

  3. (3)

    In terms of applications, the examples are validated by the provided traffic flow data, the cases are validated from three different angles, and the results show that the new model achieves good results in terms of stability performance under different conditions. Two traffic flow cases validate the performance of the new model under different traffic flow conditions. The results show that the simulation and prediction results of the new model proposed in this paper are better than those of other grey models. The proposed method provides insight into the fluctuation patterns of highway traffic flow data and exhibits good stability and prediction accuracy in both fitting and forecasting.

The remainder of this paper is organized as follows. In Sect. 2, a new Euler equation grey prediction model is proposed, and the parameters of the new model are estimated. The time response expression and the final restoration expression of the new model are derived in detail. In Sect. 3, the criteria for evaluating the performance of the model are given. In Sect. 4, the PSO algorithm with better performance is selected to optimize the order of the new model, and the modelling steps of the new model are given. In Sect. 5, a comprehensive empirical analysis is conducted from multiple perspectives to evaluate the effectiveness of the new model. This analysis encompasses various aspects, including the fitting effect and prediction accuracy. Conclusions are drawn in Sect. 6, and future research directions are outlined.

2 The establishment of the Euler equation grey prediction model

The motion of vehicles on a continuous road resembles the flow of fluid, thus forming a flowing traffic roadway. The Euler equation is a fundamental equation in fluid dynamics and is widely used. Equations of the following form are often encountered in the study of physical problems such as heat conduction, electromagnetic wave propagation, and circular membrane vibration:

$$ ax^{2} D^{2} y + bxDy + cy = f\left( x \right) $$
(1)

where \(a,{\text{b}},{\text{c}}\) represents constant and Eq. (1) is a second-order variable coefficient differential equation. The coefficients exhibit certain patterns: the coefficient of the second derivative \(D^{2} y\) is a quadratic function \(ax^{2}\), the coefficient of the first derivative \(Dy\) is a linear function \(bx\), and the coefficient \(y\) is a constant. These equations are referred to as Euler equations. In this section, we study the general form derived from the second-order Euler equation and introduce a new grey prediction model based on the Euler equation. First, the definition of the Euler equation is outlined, followed by an introduction to the model's representation, parameter estimation, and discrete solution processes.

2.1 The Euler equation

Differential equations with variable coefficients have wide applications in various fields, such as biology, electricity, and dynamics. Among them, the Euler equation is one of the most extensively used types of equations in the realm of variable coefficient differential equations and has attracted significant amounts of attention from numerous scholars. The following is the definition of the Euler equation:

Definition 1.

An equation of the form

$$ x^{n} \frac{{d^{n} y}}{{dx^{n} }} + a_{1} x^{n - 1} \frac{{d^{n - 1} y}}{{dx^{n - 1} }} + a_{2} x^{n - 2} \frac{{d^{n - 2} y}}{{dx^{n - 2} }} + \cdots + a_{n - 1} x\frac{dy}{{dx}} + a_{n} y = f(x) $$

is referred to as the Euler equation, where \(a_{1} ,a_{2} \cdots ,a_{n - 1} ,a_{n}\) are constants and \(a_{1} \ne 0\). When \(f(x) \equiv 0\),

$$ x^{n} \frac{{d^{n} y}}{{dx^{n} }} + a_{1} x^{n - 1} \frac{{d^{n - 1} y}}{{dx^{n - 1} }} + a_{2} x^{n - 2} \frac{{d^{n - 2} y}}{{dx^{n - 2} }} + \cdots + a_{n - 1} x\frac{dy}{{dx}} + a_{n} y = 0 $$
(2)

is an \(n - th\)-order linear homogeneous Euler equation. When \(f(x) \ne 0\),

$$ x^{n} \frac{{d^{n} y}}{{dx^{n} }} + a_{1} x^{n - 1} \frac{{d^{n - 1} y}}{{dx^{n - 1} }} + a_{2} x^{n - 2} \frac{{d^{n - 2} y}}{{dx^{n - 2} }} + \cdots + a_{n - 1} x\frac{dy}{{dx}} + a_{n} y = f(x) $$
(3)

is an \(n - th\)-order linear nonhomogeneous Euler equation.

2.2 Generating sequences and mean generating sequences

Definition 2.

Let \(X^{(0)} = (x^{(0)} (1),x^{(0)} (2), \cdots ,x^{(0)} (m))\) be the original nonnegative sequence, and \(X^{(1)}\) be the first-order cumulative sequence (1-AGO) of the original sequence \(X^{(0)}\); that is,where

$$ X^{(1)} = (x^{(1)} (1),x^{(1)} (2), \cdots ,x^{(1)} (m)) $$
$$ x^{(1)} (k) = \sum\limits_{i = 1}^{k} {x^{(0)} } (i),k = 1,2, \cdots ,m $$
(4)

Definition 3.

Let \(X^{(0)} = (x^{(0)} (1),x^{(0)} (2), \cdots ,x^{(0)} (m))\) be an original non-negative sequence, and \(X^{(1)}\) be given in Definition 2 above; then, \(\alpha^{(1)} X^{(1)}\) is said to be a first-order cumulative sequence of the non-negative sequences \(X^{(1)}\).

Let

$$ \alpha^{(1)} X^{(1)} = (\alpha^{(1)} x^{(1)} (1),\alpha^{(1)} x^{(1)} (2), \cdots ,\alpha^{(1)} x^{(1)} (m)) $$

where \(\alpha^{(1)} x^{(1)} (k) = x^{(1)} (k) - x^{(1)} (k - 1)\). The \(i - th\) cumulative generated sequence of \(X^{(1)}\) is denoted as \(\alpha^{(i)} X^{(1)} ,i = 1,2, \cdots n\), and the value of the specific \(\alpha^{(i)} x^{(1)} (k)\) is represented by the following equation:

$$ \begin{aligned} \alpha^{(1)} x^{(1)} (k) = & x^{(1)} (k) - x^{(1)} (k - 1) = x^{(0)} (k) \\ \alpha^{(2)} x^{(1)} (k) = & \alpha^{(1)} x^{(1)} (k) - \alpha^{(1)} x^{(1)} (k - 1) = x^{(0)} (k) - x^{(0)} (k - 1) \\ \cdots \cdots \\ \alpha^{(n)} x^{(1)} (k) = & \alpha^{(n - 1)} x^{(1)} (k) - \alpha^{(n - 1)} x^{(1)} (k - 1) = \alpha^{(n - 2)} x^{(0)} (k) - \alpha^{(n - 2)} x^{(0)} (k - 1) \\ \end{aligned} $$

Definition 4.

Let \(X^{(1)} = (x^{(1)} (1),x^{(1)} (2), \cdots ,x^{(1)} (m))\) be the same as in Definition 2; then, \(Z^{(1)}\) is the mean generating sequence of \(X^{(1)}\), \(Z^{(1)} = ({\text{z}}^{(1)} (2),{\text{z}}^{(1)} (3), \cdots ,z^{(1)} (m))\), where

$$ z^{(1)} (k) = \frac{1}{2}[x^{(1)} (k) + x^{(1)} (k - 1)],k = 2, \cdots ,m $$
(5)

2.3 Euler equation grey prediction model

Let the function \(f(x)\) in Eq. (3) be represented by the variable \(ax + b\);then, the Euler equation can be transformed into

$$ x^{n} \frac{{d^{n} y}}{{dx^{n} }} + a_{1} x^{n - 1} \frac{{d^{n - 1} y}}{{dx^{n - 1} }} + a_{2} x^{n - 2} \frac{{d^{n - 2} y}}{{dx^{n - 2} }} + \cdots + a_{n - 1} x\frac{dy}{{dx}} + a_{n} y = ax + b $$
(6)

Let \(y = x^{(1)} (t),x = t\). For convenience, we can simplify \(x^{(1)} (t)\) as \(x^{(1)}\)

$$ t^{n} \frac{{d^{n} x^{(1)} }}{{dt^{n} }} + a_{1} t^{n - 1} \frac{{d^{n - 1} x^{(1)} }}{{dt^{n - 1} }} + a_{2} t^{n - 2} \frac{{d^{n - 2} x^{(1)} }}{{dt^{n - 2} }} + \cdots + a_{n - 1} t\frac{{dx^{(1)} }}{dt} + a_{n} x^{(1)} = at + b $$
(7)

Due to

$$ \begin{aligned} \frac{{dx^{(1)} }}{dt} = & \frac{{x^{(1)} (k) - x^{(1)} (k - 1)}}{k - (k - 1)} = x^{(1)} (k) - x^{(1)} (k - 1) = \alpha^{(1)} x^{(1)} (k) = x^{(0)} (k) \\ \frac{{d^{2} x^{(1)} }}{{dt^{2} }} = & \frac{{x^{(0)} (k) - x^{(0)} (k - 1)}}{k - (k - 1)} = x^{(0)} (k) - x^{(0)} (k - 1) = \alpha^{(2)} x^{(1)} (k) \\ \cdots \cdots \\ \frac{{d^{(n - i)} x^{(1)} }}{{dt^{(n - i)} }} = & \frac{{\alpha^{(n - i - 1)} x^{(1)} (k) - \alpha^{(n - i - 1)} x^{(1)} (k - 1)}}{k - (k - 1)} = \alpha^{(n - i - 1)} x^{(1)} (k) - \alpha^{(n - i - 1)} x^{(1)} (k - 1) = \alpha^{(n - i)} x^{(1)} (k) \\ \cdots \cdots \\ \frac{{d^{n} x^{(1)} }}{{dt^{n} }} = & \frac{{\alpha^{(n - 1)} x^{(1)} (k) - \alpha^{(n - 1)} x^{(1)} (k - 1)}}{k - (k - 1)} = \alpha^{(n - 1)} x^{(1)} (k) - \alpha^{(n - 1)} x^{(1)} (k - 1) = \alpha^{(n)} x^{(1)} (k) \\ \end{aligned} $$

The following definition can be derived from the above equations.

Definition 5.

Assuming that \(X^{(0)}\), \(X^{(1)}\) and \(Z^{(1)}\) are defined as above, the equation

$$ k^{n} \alpha^{(n)} x^{(1)} (k) + a_{1} k^{n - 1} \alpha^{(n - 1)} x^{(1)} (k) + a_{2} k^{n - 2} \alpha^{(n - 2)} x^{(1)} (k) + \cdots + a_{n - 1} k\alpha^{(1)} x^{(1)} (k) + a_{n} z^{(1)} (k) = ak + b $$
(8)

is the Euler equation grey model, referred to as the EEGM(n,1) model.

where \(k = 1,2, \cdots ,m\); then, Eq. (7) is called the whitening equation of the EEGM(n,1) model.

2.4 Parameter estimation

The parameter estimates of the EEGM(n,1) model are given by Theorem 1.

Theorem 1.

The least squares estimation of the parameter vector \(\hat{p} = [a_{1} ,a_{2} , \cdots ,a_{n} ,a,b]^{T}\) in the EEGM(n,1) model is determined by the following equation:

  1. (1)

    When \(m = n + 3\) and \(|B| \ne 0\), that gives \(\hat{p} = B^{ - 1} Y\);

  2. (2)

    When \(m < n + 3\) and \(|B| \ne 0\), that gives \(\hat{p} = (B^{T} B)^{ - 1} B^{T} Y\);

  3. (3)

    When \(m < n + 3\) and \(|B| \ne 0\), that gives \(\hat{p} = B^{T} (BB^{T} )^{ - 1} Y\),

where

$$ \begin{aligned} B = & \left( {\begin{array}{*{20}l} { - 2^{n - 1} \alpha^{(n - 1)} x^{(1)} (2)} & { - 2^{n - 2} \alpha^{(n - 2)} x^{(1)} (2)} & \cdots & { - 2\alpha^{(1)} x^{(1)} (2)} & { - z^{(1)} (2)} & 2 & 1 \\ { - 3^{n - 1} \alpha^{(n - 1)} x^{(1)} (3)} & { - 3^{n - 2} \alpha^{(n - 2)} x^{(1)} (3)} & \cdots & { - 3\alpha^{(1)} x^{(1)} (3)} & { - z^{(1)} (3)} & 3 & 1 \\ \vdots & \vdots & {} & \vdots & \vdots & \vdots & \vdots \\ { - m^{n - 1} \alpha^{(n - 1)} x^{(1)} (m)} & { - m^{n - 2} \alpha^{(n - 2)} x^{(1)} (m)} & \cdots & { - m\alpha^{(1)} x^{(1)} (m)} & { - z^{(1)} (m)} & m & 1 \\ \end{array} } \right) \\ Y = & \left( {\begin{array}{*{20}l} {2^{n} \alpha^{(n)} x_{1}^{(1)} (2)} \\ {3^{n} \alpha^{(n)} x_{1}^{(1)} (3)} \\ \vdots \\ {m^{n} \alpha^{(n)} x_{1}^{(1)} (m)} \\ \end{array} } \right) \\ \end{aligned} $$

Proof:

According to the definition provided by the EEGM(n,1) model:

$$ \left\{ \begin{gathered} 2^{n} \alpha^{(n)} x^{(1)} (2) + a_{1} 2^{n - 1} \alpha^{(n - 1)} x^{(1)} (2) + a_{2} 2^{n - 2} \alpha^{(n - 2)} x^{(1)} (2) + \cdots + a_{n - 1} 2\alpha^{(1)} x^{(1)} (2) + a_{n} z^{(1)} (2) = 2a + b \hfill \\ 3^{n} \alpha^{(n)} x^{(1)} (3) + a_{1} 3^{n - 1} \alpha^{(n - 1)} x^{(1)} (3) + a_{2} 3^{n - 2} \alpha^{(n - 2)} x^{(1)} (3) + \cdots + a_{n - 1} 3\alpha^{(1)} x^{(1)} (3) + a_{n} z^{(1)} (3) = 3a + b \hfill \\ \vdots \hfill \\ m^{n} \alpha^{(n)} x^{(1)} (m) + a_{1} m^{n - 1} \alpha^{(n - 1)} x^{(1)} (m) + a_{2} m^{n - 2} \alpha^{(n - 2)} x^{(1)} (m) + \cdots + a_{n - 1} m\alpha^{(1)} x^{(1)} (m) + a_{n} z^{(1)} (m) = ma + b \hfill \\ \end{gathered} \right. $$
(9)

Thus, it can be inferred that

$$ \left\{ \begin{aligned} &2^{n} \alpha^{(n)} x^{(1)} (2) = - a_{1} 2^{n - 1} \alpha^{(n - 1)} x^{(1)} (2) - a_{2} 2^{n - 2} \alpha^{(n - 2)} x^{(1)} (2) - \cdots - a_{n - 1} 2\alpha^{(1)} x^{(1)} (2) - a_{n} z^{(1)} (2) + 2a + b \hfill \\ &3^{n} \alpha^{(n)} x^{(1)} (3) = - a_{1} 3^{n - 1} \alpha^{(n - 1)} x^{(1)} (3) - a_{2} 3^{n - 2} \alpha^{(n - 2)} x^{(1)} (3) - \cdots - a_{n - 1} 3\alpha^{(1)} x^{(1)} (3) - a_{n} z^{(1)} (3) + 3a + b \hfill \\ &\vdots \hfill \\ &m^{n} \alpha^{(n)} x^{(1)} (m) = - a_{1} m^{n - 1} \alpha^{(n - 1)} x^{(1)} (m) - a_{2} m^{n - 2} \alpha^{(n - 2)} x^{(1)} (m) - \cdots - a_{n - 1} m\alpha^{(1)} x^{(1)} (m) - a_{n} z^{(1)} (m)m + a + b \hfill \\ \end{aligned} \right. $$
(10)

Equation (10) can be rewritten in matrix form as follows:

$$ Y = B\hat{p} $$
(11)

By utilizing the properties of matrices, the following can be inferred:

  1. (1)

    When \(m - 1 = n + 2\), i.e.\(m = n + 3\), the matrix \(B\) at this point is invertible, i.e.\(|B| \ne 0\), \(\hat{p} = B^{ - 1} Y\) can be obtained;

  2. (2)

    When \(m - 1 > n + 2\), i.e.\(m > n + 3\), \(B\) is a column-full rank matrix and \(|B^{T} B| \ne 0\); then, there exist matrices for which \(A\) is a matrix of \((m - 1) \times (n + 2)\) and \(C\) is a matrix of \((n + 2) \times (n + 2)\) with \(B = AC\). Then the generalized inverse matrix \(B^{\dag }\) of \(B\) is denoted by:

    $$ B^{\dag } = C^{T} (CC^{T} )^{ - 1} (A^{T} A)^{ - 1} A^{T} $$
    (12)

Since \(B\) is a column full rank matrix, let \(C = I_{n + 1}\) and obtain:

$$ B = AC = AI_{n + 1} = A $$
(13)

Therefore:

$$ \hat{p} = C^{T} (CC^{T} )^{ - 1} (A^{T} A)^{ - 1} A^{T} Y = I_{n + 1}^{T} (I_{n + 1} I_{n + 1}^{T} )^{ - 1} (B^{T} B)^{ - 1} B^{T} Y = (B^{T} B)^{ - 1} B^{T} Y $$
(14)
  1. (3)

    When \(m - 1 < n + 2\), i.e.\(m < n + 3\),\(B\) is a row-full rank matrix and \(|BB^{T} | \ne 0\); then, \(A\) is a matrix of \((m - 1) \times (m - 1)\) and \(C\) is a matrix of \((m - 1) \times (n + 2)\) with \(B = AC\). Let \(A = I_{m - 1}\); then, we have:

    $$ B = AC = I_{m - 1} C = C $$
    (15)

Therefore:

$$ \hat{p} = C^{T} (CC^{T} )^{ - 1} (A^{T} A)^{ - 1} A^{T} Y = B^{T} (BB^{T} )^{ - 1} (I_{m - 1}^{T} I_{m - 1} )^{ - 1} I_{m - 1}^{T} Y = B^{T} (BB^{T} )^{ - 1} Y $$
(16)

Proof of the end.

2.5 Time response functions of the EEGM(n,1) model

The time response function of the EEGM(n,1) model is discussed below and is given by Theorem 2.

Theorem 2.

The time response sequence of the EEGM(n,1) model is

$$ \begin{aligned} \hat{x}^{(1)} (k) = & \frac{f(k) + 2}{{f(k)}}\hat{x}^{(1)} (k - 1) + \frac{{\lambda_{n} k^{n} }}{f(k)}\sum\limits_{i = 1}^{n - 1} {\alpha^{(i)} \hat{x}^{(1)} (k - 1)} + \frac{{\lambda_{n - 1} k^{n - 1} }}{f(k)}\sum\limits_{i = 1}^{n - 2} {\alpha^{(i)} \hat{x}^{(1)} (k - 1)} + \cdots \\ & + \frac{{\lambda_{2} k^{2} }}{f(k)}\alpha^{(1)} \hat{x}^{(1)} (k - 1) - \frac{{\gamma_{1} }}{f(k)}k - \frac{{\gamma_{2} }}{f(k)},k = 1,2, \cdots m \\ \end{aligned} $$
(17)

The restored sequence of the EEGM(n,1) model is

$$ \begin{aligned} \hat{x}^{(0)} (k) = & \frac{f(k) + 2}{{f(k)}}\hat{x}^{(1)} (k - 1) + \frac{{\lambda_{n} k^{n} }}{f(k)}\sum\limits_{i = 1}^{n - 1} {\alpha^{(i)} \hat{x}^{(1)} (k - 1)} + \cdots + \frac{{\lambda_{2} k^{2} }}{f(k)}\alpha^{(1)} \hat{x}^{(1)} (k - 1) \\ & - \frac{f(k - 1) + 2}{{f(k - 1)}}\hat{x}^{(1)} (k - 2) - \frac{{\lambda_{n} (k - 1)^{n} }}{f(k - 1)}\sum\limits_{i = 1}^{n - 1} {\alpha^{(i)} \hat{x}^{(1)} (k - 2)} - \cdots - \frac{{\lambda_{2} (k - 1)^{2} }}{f(k - 1)}\alpha^{(1)} \hat{x}^{(1)} (k - 2) \\ & + \frac{{\gamma_{1} }}{f(k - 1)}(k - 1) + \frac{{\gamma_{2} }}{f(k - 1)} - \frac{{\gamma_{1} }}{f(k)}k - \frac{{\gamma_{2} }}{f(k)},k = 1,2, \cdots m \\ \end{aligned} $$
(18)

\(\hat{x}^{(1)} (k)\) and \(\hat{x}^{(0)} (k)\) respectively denote the predicted sequence and its restored values corresponding to the original sequence \(x^{(1)} (k)\) and \(x^{(0)} (k)\). Additionally, \(f(k) = \lambda_{n} k^{n} + \lambda_{n - 1} k^{n - 1} + \cdots + \lambda_{1} k - 1\).

Proof:

By utilizing the EEGM(n,1) model and the definition of the mean sequence, we can substitute Eq. (5) into Eq. (8) to obtain

$$ \begin{gathered} k^{n} \alpha^{(n)} x^{(1)} (k) + a_{1} k^{n - 1} \alpha^{(n - 1)} x^{(1)} (k) + a_{2} k^{n - 2} \alpha^{(n - 2)} x^{(1)} (k) + \cdots + a_{n - 1} k\alpha^{(1)} x^{(1)} (k) + \frac{{a_{n} }}{2}[\hat{x}^{(1)} (k) + \hat{x}^{(1)} (k - 1)] \hfill \\ = ak + b \hfill \\ \end{gathered} $$
(19)

From this it follows

$$ \begin{aligned} \frac{{a_{n} }}{2}\hat{x}^{(1)} (k) = & - k^{n} \alpha^{(n)} x^{(1)} (k) - a_{1} k^{n - 1} \alpha^{(n - 1)} x^{(1)} (k) - a_{2} k^{n - 2} \alpha^{(n - 2)} x^{(1)} (k) - \cdots \\ & - a_{n - 1} k\alpha^{(1)} x^{(1)} (k) - \frac{{a_{n} }}{2}\hat{x}^{(1)} (k - 1) + ak + b \\ \end{aligned} $$
(20)

That is

$$ \begin{aligned} \hat{x}^{(1)} (k) = & - \frac{2}{{a_{n} }}k^{n} \alpha^{(n)} x^{(1)} (k) - \frac{{2a_{1} }}{{a_{n} }}k^{n - 1} \alpha^{(n - 1)} x^{(1)} (k) - \frac{{2a_{2} }}{{a_{n} }}k^{n - 2} \alpha^{(n - 2)} x^{(1)} (k) - \cdots - \frac{{2a_{n - 1} }}{{a_{n} }}k\alpha^{(1)} x^{(1)} (k) \\ & - \hat{x}^{(1)} (k - 1) + \frac{2a}{{a_{n} }}k + \frac{2}{{a_{n} }}b \\ \end{aligned} $$
(21)

Let \(\lambda_{n} = - \frac{2}{{a_{n} }},\lambda_{n - 1} = - \frac{{2a_{1} }}{{a_{n} }}, \cdots ,\lambda_{1} = - \frac{{2a_{n - 1} }}{{a_{n} }},\lambda_{0} = - 1,\gamma_{1} = \frac{2a}{{a_{n} }},\gamma_{2} = \frac{2b}{{a_{n} }}\), then Eq. (21) can be converted into

$$ \begin{aligned} \hat{x}^{(1)} (k) = & \lambda_{n} k^{n} \alpha^{(n)} x^{(1)} (k) + \lambda_{n - 1} k^{n - 1} \alpha^{(n - 1)} x^{(1)} (k) + \lambda_{n - 2} k^{n - 2} \alpha^{(n - 2)} x^{(1)} (k) + \cdots + \lambda_{1} k\alpha^{(1)} x^{(1)} (k) \\ & + \lambda_{0} \hat{x}^{(1)} (k - 1) + \gamma_{1} k + \gamma_{2} \\ \end{aligned} $$
(22)

Because

$$ \begin{aligned} \alpha^{(n)} x^{(1)} (k) = & \alpha^{(n - 1)} x^{(1)} (k) - \alpha^{(n - 1)} x^{(1)} (k - 1) \\ \alpha^{(n - 1)} x^{(1)} (k) = & \alpha^{(n - 2)} x^{(1)} (k) - \alpha^{(n - 2)} x^{(1)} (k - 1) \\ \alpha^{(n - 2)} x^{(1)} (k) = & \alpha^{(n - 3)} x^{(1)} (k) - \alpha^{(n - 3)} x^{(1)} (k - 1) \\ \vdots \\ \alpha^{(1)} x^{(1)} (k) = & x^{(1)} (k) - x^{(1)} (k - 1) \\ \end{aligned} $$

Therefore

$$ \begin{aligned} \alpha^{(n)} x^{(1)} (k) = & \alpha^{(n - 1)} x^{(1)} (k) - \alpha^{(n - 1)} x^{(1)} (k - 1) \\ = & \alpha^{(n - 2)} x^{(1)} (k) - \alpha^{(n - 2)} x^{(1)} (k - 1) - \alpha^{(n - 1)} x^{(1)} (k - 1) \\ = & \alpha^{(n - 3)} x^{(1)} (k) - \alpha^{(n - 3)} x^{(1)} (k - 1) - \alpha^{(n - 2)} x^{(1)} (k - 1) - \alpha^{(n - 1)} x^{(1)} (k - 1) \\ = & \cdots \\ = & \alpha^{(1)} x^{(1)} (k) - \alpha^{(1)} x^{(1)} (k - 1) - \alpha^{(2)} x^{(1)} (k - 1) - \cdots - \alpha^{(n - 1)} x^{(1)} (k - 1) \\ = & x^{(1)} (k) - x^{(1)} (k - 1) - \sum\limits_{i = 1}^{n - 1} {\alpha^{(i)} x^{(1)} (k - 1)} \\ \alpha^{(n - 1)} x^{(1)} (k) = & \alpha^{(n - 2)} x^{(1)} (k) - \alpha^{(n - 2)} x^{(1)} (k - 1) \\ = & \alpha^{(n - 3)} x^{(1)} (k) - \alpha^{(n - 3)} x^{(1)} (k - 1) - \alpha^{(n - 2)} x^{(1)} (k - 1) \\ = & \alpha^{(n - 4)} x^{(1)} (k) - \alpha^{(n - 4)} x^{(1)} (k - 1) - \alpha^{(n - 3)} x^{(1)} (k - 1) - \alpha^{(n - 2)} x^{(1)} (k - 1) \\ = & \cdots \\ = & \alpha^{(1)} x^{(1)} (k) - \alpha^{(1)} x^{(1)} (k - 1) - \alpha^{(2)} x^{(1)} (k - 1) - \cdots - \alpha^{(n - 2)} x^{(1)} (k - 1) \\ = & x^{(1)} (k) - x^{(1)} (k - 1) - \sum\limits_{i = 1}^{n - 2} {\alpha^{(i)} x^{(1)} (k - 1)} \\ \end{aligned} $$

Expanding in turn leads to

$$ \begin{aligned} \alpha^{(n - 2)} x^{(1)} (k) =&\, x^{(1)} (k) - x^{(1)} (k - 1) - \sum\limits_{i = 1}^{n - 3} {\alpha^{(i)} x^{(1)} (k - 1)} \hfill \\ &\quad\vdots \hfill \\ \alpha^{(2)} x^{(1)} (k) =&\, x^{(1)} (k) - x^{(1)} (k - 1) - \alpha^{(1)} x^{(1)} (k - 1) \hfill \\ \alpha^{(1)} x^{(1)} (k) =& x^{(1)} (k) - x^{(1)} (k - 1) \hfill \\ \end{aligned} $$

By substituting \(\alpha^{(i)} x^{(1)} (k),i = 1,2, \cdots ,n\) into Eq. (22), we obtain

$$ \begin{aligned} \hat{x}^{(1)} (k) = & \lambda_{n} k^{n} [\hat{x}^{(1)} (k) - \hat{x}^{(1)} (k - 1) - \sum\limits_{i = 1}^{n - 1} {\alpha^{(i)} \hat{x}^{(1)} (k - 1)} ] + \lambda_{n - 1} k^{n - 1} [\hat{x}^{(1)} (k) - \hat{x}^{(1)} (k - 1) \\ & - \sum\limits_{i = 1}^{n - 2} {\alpha^{(i)} \hat{x}^{(1)} (k - 1)} ] + \lambda_{n - 2} k^{n - 2} [\hat{x}^{(1)} (k) - \hat{x}^{(1)} (k - 1) - \sum\limits_{i = 1}^{n - 3} {\alpha^{(i)} \hat{x}^{(1)} (k - 1)} ] + \cdots + \lambda_{1} k[\hat{x}^{(1)} (k) \\ & - \hat{x}^{(1)} (k - 1)] + \lambda_{0} \hat{x}^{(1)} (k - 1) + \gamma_{1} k + \gamma_{2} \\ \end{aligned} $$
(23)

By simplifying Eq. (23), we obtain

$$ \begin{gathered} (\lambda_{n} k^{n} + \lambda_{n - 1} k^{n - 1} + \cdots + \lambda_{1} k - 1)\hat{x}^{(1)} (k) = \lambda_{n} k^{n} [\hat{x}^{(1)} (k - 1) + \sum\limits_{i = 1}^{n - 1} {\alpha^{(i)} \hat{x}^{(1)} (k - 1)} ] + \lambda_{n - 1} k^{n - 1} [\hat{x}^{(1)} (k - 1) \hfill \\ + \sum\limits_{i = 1}^{n - 2} {\alpha^{(i)} \hat{x}^{(1)} (k - 1)} ] + \lambda_{n - 2} k^{n - 2} [\hat{x}^{(1)} (k - 1) + \sum\limits_{i = 1}^{n - 3} {\alpha^{(i)} \hat{x}^{(1)} (k - 1)} ] + \cdots + \lambda_{1} k\hat{x}^{(1)} (k - 1) - \lambda_{0} \hat{x}^{(1)} (k - 1) \hfill \\ - \gamma_{1} k - \gamma_{2} \hfill \\ \end{gathered} $$
(24)

Therefore

$$ \begin{aligned} \hat{x}^{(1)} (k) = & \frac{{\lambda_{n} k^{n} }}{{\lambda_{n} k^{n} + \lambda_{n - 1} k^{n - 1} + \cdots + \lambda_{1} k - 1}}[\hat{x}^{(1)} (k - 1) + \sum\limits_{i = 1}^{n - 1} {\alpha^{(i)} \hat{x}^{(1)} (k - 1)} ] + \frac{{\lambda_{n - 1} k^{n - 1} }}{{\lambda_{n} k^{n} + \lambda_{n - 1} k^{n - 1} + \cdots + \lambda_{1} k - 1}} \\ & [\hat{x}^{(1)} (k - 1) + \sum\limits_{i = 1}^{n - 2} {\alpha^{(i)} \hat{x}^{(1)} (k - 1)} ] + \frac{{\lambda_{n - 2} k^{n - 2} }}{{\lambda_{n} k^{n} + \lambda_{n - 1} k^{n - 1} + \cdots + \lambda_{1} k - 1}}[\hat{x}^{(1)} (k - 1) + \sum\limits_{i = 1}^{n - 3} {\alpha^{(i)} \hat{x}^{(1)} (k - 1)} ] \\ & + \cdots + \frac{{\lambda_{1} k - \lambda_{0} }}{{\lambda_{n} k^{n} + \lambda_{n - 1} k^{n - 1} + \cdots + \lambda_{1} k - 1}}\hat{x}^{(1)} (k - 1) - \frac{{\gamma_{1} }}{{\lambda_{n} k^{n} + \lambda_{n - 1} k^{n - 1} + \cdots + \lambda_{1} k - 1}}k \\ & - \frac{{\gamma_{2} }}{{\lambda_{n} k^{n} + \lambda_{n - 1} k^{n - 1} + \cdots + \lambda_{1} k - 1}} \\ \end{aligned} $$
(25)

When all the parameters of the model are determined, for the variable time point \(k\) of Eq. (25), there are

$$ \frac{{\lambda_{l} k^{l} }}{{\lambda_{n} k^{n} + \lambda_{n - 1} k^{n - 1} + \cdots + \lambda_{1} k - 1}},l = 0,1, \cdots ,n $$

The equation is varied with time \(k\). At this point, since the order of the equation is set to \(n\), for each \(\alpha^{(n - i)} \hat{x}^{(1)} (k - 1),i = 1,2, \cdots n - 1\) in the above equation, it is an \(n - i\) cumulative reduction of \(\hat{x}^{(1)} (k - 1)\), so that the Eq. (25) is an overall circulation, thus giving the corresponding expression for the loop and letting the initial value condition be

$$ \alpha^{(1)} \hat{x}^{(1)} (1) = \alpha^{(2)} \hat{x}^{(1)} (1) = \cdots = \alpha^{(n)} \hat{x}^{(1)} (1) = \hat{x}^{(1)} (1) = x^{(0)} (1) $$

For \(k = 2\), we have

$$ \begin{aligned} \hat{x}^{(1)} (2) = & \frac{{2^{n} \lambda_{n} }}{{2^{n} \lambda_{n} + 2^{n - 1} \lambda_{n - 1} + \cdots + 2\lambda_{1} - 1}}n\hat{x}^{(1)} (1) + \frac{{2^{n - 1} \lambda_{n - 1} }}{{2^{n} \lambda_{n} + 2^{n - 1} \lambda_{n - 1} + \cdots + 2\lambda_{1} - 1}}(n - 1)\hat{x}^{(1)} (1) + \cdots \\ & + \frac{{2\lambda_{1} - \lambda_{0} }}{{2^{n} \lambda_{n} + 2^{n - 1} \lambda_{n - 1} + \cdots + 2\lambda_{1} - 1}}\hat{x}^{(1)} (1) - \frac{{2\gamma_{1} }}{{2^{n} \lambda_{n} + 2^{n - 1} \lambda_{n - 1} + \cdots + 2\lambda_{1} - 1}} - \frac{{\gamma_{2} }}{{2^{n} \lambda_{n} + 2^{n - 1} \lambda_{n - 1} + \cdots + 2\lambda_{1} - 1}} \\ = & \frac{{2^{n} \lambda_{n} }}{{2^{n} \lambda_{n} + 2^{n - 1} \lambda_{n - 1} + \cdots + 2\lambda_{1} - 1}}nx^{(0)} (1) + \frac{{2^{n - 1} \lambda_{n - 1} }}{{2^{n} \lambda_{n} + 2^{n - 1} \lambda_{n - 1} + \cdots + 2\lambda_{1} - 1}}(n - 1)x^{(0)} (1) + \cdots \\ & + \frac{{2\lambda_{1} - \lambda_{0} }}{{2^{n} \lambda_{n} + 2^{n - 1} \lambda_{n - 1} + \cdots + 2\lambda_{1} - 1}}x^{(0)} (1) - \frac{{2\gamma_{1} }}{{2^{n} \lambda_{n} + 2^{n - 1} \lambda_{n - 1} + \cdots + 2\lambda_{1} - 1}} - \frac{{\gamma_{2} }}{{2^{n} \lambda_{n} + 2^{n - 1} \lambda_{n - 1} + \cdots + 2\lambda_{1} - 1}} \\ \end{aligned} $$

After determining the values of the parameters, the value of \(\hat{x}^{(1)} (2)\) can be calculated. Subsequently, by substituting \(\hat{x}^{(1)} (2)\) into Eq. (25) and iteratively setting \(k = 3, \cdots ,m\), the value of \(\hat{x}^{(1)} (k)\) can also be obtained. When the function \(f(s) = \lambda_{n} s^{n} + \lambda_{n - 1} s^{n - 1} + \cdots + \lambda_{1} s - 1,s \in N^{ + }\) is combined with \(\lambda_{0} = - 1\), the following can be obtained:

$$ \begin{aligned} \hat{x}^{(1)} (k) = & \frac{f(k) + 2}{{f(k)}}\hat{x}^{(1)} (k - 1) + \frac{{\lambda_{n} k^{n} }}{f(k)}\sum\limits_{i = 1}^{n - 1} {\alpha^{(i)} \hat{x}^{(1)} (k - 1)} + \frac{{\lambda_{n - 1} k^{n - 1} }}{f(k)}\sum\limits_{i = 1}^{n - 2} {\alpha^{(i)} \hat{x}^{(1)} (k - 1)} + \cdots \\ & + \frac{{\lambda_{2} k^{2} }}{f(k)}\alpha^{(1)} \hat{x}^{(1)} (k - 1) - \frac{{\gamma_{1} }}{f(k)}k - \frac{{\gamma_{2} }}{f(k)} \\ \end{aligned} $$
(26)

Consequently, it can be inferred that

$$ \begin{aligned} \hat{x}^{(0)} (k) = & \hat{x}^{(1)} (k) - \hat{x}^{(1)} (k - 1) \\ = & \frac{f(k) + 2}{{f(k)}}\hat{x}^{(1)} (k - 1) + \frac{{\lambda_{n} k^{n} }}{f(k)}\sum\limits_{i = 1}^{n - 1} {\alpha^{(i)} \hat{x}^{(1)} (k - 1)} + \frac{{\lambda_{n - 1} k^{n - 1} }}{f(k)}\sum\limits_{i = 1}^{n - 2} {\alpha^{(i)} \hat{x}^{(1)} (k - 1)} + \cdots \\ & + \frac{{\lambda_{2} k^{2} }}{f(k)}\alpha^{(1)} \hat{x}^{(1)} (k - 1) - \frac{{\gamma_{1} }}{f(k)}k - \frac{{\gamma_{2} }}{f(k)} - \frac{f(k - 1) + 2}{{f(k - 1)}}\hat{x}^{(1)} (k - 2) - \frac{{\lambda_{n} (k - 1)^{n} }}{f(k - 1)}\sum\limits_{i = 1}^{n - 1} {\alpha^{(i)} \hat{x}^{(1)} (k - 2)} \\ & - \frac{{\lambda_{n - 1} (k - 1)^{n - 1} }}{f(k - 1)}\sum\limits_{i = 1}^{n - 2} {\alpha^{(i)} \hat{x}^{(1)} (k - 2)} - \cdots - \frac{{\lambda_{2} (k - 1)^{2} }}{f(k - 1)}\alpha^{(1)} \hat{x}^{(1)} (k - 2) + \frac{{\gamma_{1} }}{f(k - 1)}(k - 1) + \frac{{\gamma_{2} }}{f(k - 1)} \\ \end{aligned} $$
(27)

Organized as follows

$$ \begin{aligned} \hat{x}^{(0)} (k) = & \frac{f(k) + 2}{{f(k)}}\hat{x}^{(1)} (k - 1) + \frac{{\lambda_{n} k^{n} }}{f(k)}\sum\limits_{i = 1}^{n - 1} {\alpha^{(i)} \hat{x}^{(1)} (k - 1)} + \cdots + \frac{{\lambda_{2} k^{2} }}{f(k)}\alpha^{(1)} \hat{x}^{(1)} (k - 1) \\ & - \frac{f(k - 1) + 2}{{f(k - 1)}}\hat{x}^{(1)} (k - 2) - \frac{{\lambda_{n} (k - 1)^{n} }}{f(k - 1)}\sum\limits_{i = 1}^{n - 1} {\alpha^{(i)} \hat{x}^{(1)} (k - 2)} - \cdots - \frac{{\lambda_{2} (k - 1)^{2} }}{f(k - 1)}\alpha^{(1)} \hat{x}^{(1)} (k - 2) \\ & + \frac{{\gamma_{1} }}{f(k - 1)}(k - 1) + \frac{{\gamma_{2} }}{f(k - 1)} - \frac{{\gamma_{1} }}{f(k)}k - \frac{{\gamma_{2} }}{f(k)} \\ \end{aligned} $$
(28)

End of proof.

3 Model performance evaluation criteria

To validate the accuracy and reliability of the proposed predictive model, it is crucial to select effective criteria for evaluating the prediction accuracy. The original sequence is divided into two parts: the simulated sequence and the predicted sequence. Three commonly used statistical metrics, namely, the absolute percentage error (APE), mean absolute percentage error (MAPE), and comprehensive mean relative percentage error (CMRPE), are employed to assess the accuracy of both the simulated and predicted stages. The performance evaluation criteria are presented below.

Given the original sequence

$$ X^{(0)} = (x^{(0)} (1),x^{(0)} (2), \cdots ,x^{(0)} (m),x^{(0)} (m + 1), \cdots ,x^{(0)} (m + p)) $$

A grey prediction model is created using the first \(m\) elements of the sequence, with the following \(p\) datas as the prediction sequence to test the accuracy of the model. The corresponding simulated sequence and predicted sequence are given as:

$$ \begin{aligned} \hat{X}_{S}^{(0)} = & (\hat{x}^{(0)} (1),\hat{x}^{(0)} (2), \cdots ,\hat{x}^{(0)} (m)) \\ \hat{X}_{P}^{(0)} = & (\hat{x}^{(0)} (m + 1),\hat{x}^{(0)} (m + 2) \cdots ,\hat{x}^{(0)} (m + p)) \\ \end{aligned} $$

The corresponding error sequences for simulation and prediction are

$$ \begin{aligned} \delta_{S} = & (\delta (1),\delta (2), \cdots ,\delta (m)) \\ \delta_{P} = & (\delta (m + 1),\delta (m + 2) \cdots ,\delta (m + p)) \\ \end{aligned} $$

where \(\delta (i) = x^{(0)} (i) - \hat{x}^{(0)} (i),i = 1,2, \cdots ,m + p\).

The corresponding absolute percentage error (APE) is defined as

$$ APE = \left| {\frac{\delta (i)}{{x^{(0)} (i)}}} \right| \times 100\% ,i = 1,2, \cdots ,m + p $$
(29)

The mean absolute simulated percentage error (MAPEs) is defined as

$$ MAPEs = \sum\limits_{i = 1}^{m} \frac{1}{m} \left| {\frac{\delta (i)}{{x^{(0)} (i)}}} \right| \times 100\% ,i = 1,2, \cdots ,m $$
(30)

The mean absolute predicted percentage error (MAPEp) is defined as

$$ MAPEp = \sum\limits_{i = m + 1}^{m + p} \frac{1}{p} \left| {\frac{\delta (i)}{{x^{(0)} (i)}}} \right| \times 100\% ,i = m + 1,m + 2, \cdots ,m + p $$
(31)

The comprehensive mean relative percentage error (CMRPE) is defined as

$$ CMRPE = \frac{MAPEs + MAPEp}{2} $$
(32)

4 Particle swarm optimization for EEGM(n,1) model

In this section, the working principle of the particle swarm optimization algorithm and the search process for the order of the EEGM(n,1) model based on particle swarm optimization are introduced.

4.1 Particle swarm optimization for finding the optimal order

In this section, the particle swarm algorithm [38] (PSO) is employed to determine the optimal solution for the parameters to improve the prediction accuracy. The principle of PSO is to randomly initialize particles and then iteratively update their velocities and positions to search for the optimal solution. Each particle moves in the direction of its individual best and global best, and in the multidimensional search process, the update equations for the velocity and position of each particle are as follows:

$$ v_{id}^{{k_{0} }} = wv_{id}^{{k_{0} - 1}} + c_{1} rand_{1} (p_{id}^{ * } - x_{id}^{{k_{0} - 1}} ) + c_{2} rand_{2} (g_{d}^{ * } - x_{id}^{{k_{0} - 1}} ) $$
(33)
$$ x_{id}^{{k_{0} }} = x_{id}^{{k_{0} - 1}} + v_{id}^{{k_{0} }} $$
(34)

Here, \(id\) denotes particle \(i\) in the \(d - th\) dimension; \(k_{0}\) is the number of iterations, the maximum of which can range between 100 and 1000 and is set to 100 in this paper; and \(w\) is the inertia weight, whose value is between 0 and 1 and is set to 0.8 in this paper; \(c_{1}\) and \(c_{2}\) are the two acceleration constants, which are also referred to as learning factors; the former is the individual learning factor of each particle, and the latter is the social learning factor of each particle. Generally, \(c_{1} = c_{2} \in [0,4]\) and is set to 0.5 in this paper; \(rand_{1}\) and \(rand_{2}\) are two random numbers uniformly distributed in (0,1). \(p^{ * }\) and \(g^{ * }\) denote the individual optimal position and the global optimal position, respectively.

Therefore, an optimization problem is constructed to find the optimal value of n by using the minimum CMRPE as the objective function, and the expression of the optimization problem is as follows:

$$ \mathop {CMRPE_{\min } }\limits_{n} = \frac{1}{2}\left( {\sum\limits_{i = 1}^{m} \frac{1}{m} \left| {\frac{\delta (i)}{{x^{(0)} (i)}}} \right| + \sum\limits_{i = m + 1}^{m + p} \frac{1}{p} \left| {\frac{\delta (i)}{{x^{(0)} (i)}}} \right|} \right) \times 100\% $$
(35)

Therefore, the EEGM(n,1) model can be better applied in real cases. As overfitting may occur if the order of the EEGM(n,1) model is too high, it is worth advocating providing the range of the order of the EEGM(n,1) model during the modelling process; therefore, the range of the model's order is set to \(n \le 50\) in this paper.

4.2 Modeling steps for the EEGM(n,1) model

The modeling steps of the EEGM(n,1) model are as follows:

Step 1 Input initial sequence: The original data sequence \(X^{(0)}\) is input;

Step 2 Preprocess the data: For the original sequence \(X^{(0)}\), the corresponding first-order cumulative sequence \(X^{(1)}\), the \(i - order\) cumulative sequence \(\alpha^{(i)} X^{(1)}\) and the mean generating sequence \(Z^{(1)}\) are calculated according to Definitions 2, 3, and 4, respectively;

Step 3 Build the proposed model and estimate its parameters: The matrices \(B\) and \(Y\) of the model are constructed based on the defined sequences \(\alpha^{(i)} X^{(1)}\) and \(Z^{(1)}\), and the estimated values of the parameters \(a_{1} ,a_{2} , \cdots ,a_{n} ,a,b\) are obtained;

Step 4 Optimize the model order: The particle swarm algorithm is used to optimize the order \(n\), and the model is constructed based on the found optimal order and the parameter values calculated by the least squares method;

Step 5 Generate the time response function to obtain the simulated and predicted values: the simulated and predicted values are calculated using the formula in Theorem 2;

Step 6 Test the model error: The simulation and prediction errors are calculated according to the performance index evaluation criteria of the EEGM(n,1) model, and the simulation and prediction performance of the model is analyzed;

Step 7 Verify the validity of the EEGM(n,1) model: The model is applied to an actual case to verify its excellent prediction performance.

Based on the above main steps, Fig. 1 presents a sequential flowchart of the EEGM(n,1) model.

Fig. 1
figure 1

Step-by-step flowchart of the EEGM(n,1) model

5 Application of the EEGM(n,1) model to short-term traffic flow prediction

5.1 Data analysis

The data for the study was obtained from the urban highway data of Whitemud Drive in Canada, provided by the Intelligent Transportation Research Center of the University of Alberta [39].

In this section, three cases were used to verify the validity and accuracy of the EEGM(n,1) model, and data from Friday, August 14, which is a nonholiday day, were selected to perform a valid analysis of the application of this model. For Case 1, two sets of data, one from 16:40 to17:30 and the other from 18:20 to 19:25, were selected. The sequence length in the first set of data was 9, and that in the second set was 14. For these two sets of data, we used a model with different structures to predict the same number of steps with different sequence lengths. For Case 2, the traffic flow data from 18:00 to 19:25 on Friday, August 14th, were selected, and a total of 18 data were obtained. In addition, data from 18:00 to 19:05 and 18:00 to 19:10 were selected as the initial sequences to verify the performance of the model in terms of processing the data after rolling three times. For Case 3, the period from 16:40 to 17:50 was selected. The first 12 data were used to build the prediction model, and the last three data were used to test the prediction error and to compare the results with those of the NGM(1,1) model [40], Verhulst model [41], GM(2,1) model [41], WGM(1,1) model [42], CCRGM(1,1) model [43], and NGBM(1,1,k,c) model [22].

5.2 Numerical simulations and case studies

5.2.1 Case 1: Predictions with the same step size for two different periods on the same day

Traffic flow data with 5-min intervals for the periods 16:45–17:30 and 18:20–19:25 on August 14 are selected. The total length of the original data for the first period is 10, and the first 8 data are used to construct the model. Predictions are made for the last two data. The optimal order of this set of data is found to be 6 by the optimization algorithm, and the MAPE is computed for both the simulation and prediction scenarios. The outcomes of this analysis are presented in Table 1 and Table 3. The total length of the data for the second period is 14, and the first 12 data are selected as the simulated data. The prediction is performed for the last two data. The optimal order of this set of data is found to be 10 by the PSO algorithm, and the MAPE is computed for both the simulation and prediction scenarios. The outcomes of this analysis are presented in Tables 2 and 3.

Table 1 Simulation and prediction effects of the traffic flow model for 16:45–17:30
Table 2 Simulation and prediction effects of the traffic flow model for 18:20–19:25
Table 3 Three evaluation indicators for 16:45–17:30 and 18:20–19:25

Table 3 shows that the new model yields simulation errors of 9.4211% and 9.0122% during the periods of 16:45–17:30 and 18:20–19:25, respectively. The prediction errors are 4.2829% and 3.1790% for the same periods, respectively. Furthermore, the CMRPE of the new model is approximately 6% for both the simulation and prediction, indicating that the model has a higher prediction performance. In terms of the structure of the model, the different optimal orders obtained by the algorithm and the different model structures prove that the results obtained by predicting two different sets of data with the same step length under different model structures are satisfactory; in terms of the modelling object, it is verified that the model stably and accurately predicts the two sets of data with different lengths. To conduct a more comprehensive examination of the effectiveness of the model in simulating and predicting outcomes, Fig. 2 is plotted.

Fig. 2
figure 2

Simulation and prediction of traffic flow data for two different periods for Case 1

Figure 2a shows the simulated and predicted fitting curves for the first set of data. Compared with the original data, except for a slight deviation from the actual trend at 16:50, the new model not only fits the original data better in the simulation phase but also obtains the same reflection in the prediction phase. Figure 2b shows the fitting curves of the simulated and predicted data for the second group, from which it can be intuitively observed that the simulated trend of the model is almost the same as the actual trend. In summary, the model effectively conforms to the distinct features of traffic flow data. This finding indicates that the model achieves a good prediction effect, which fully demonstrates that the model is suitable for trend simulation and prediction of traffic flow systems.

5.3 Case 2: Prediction of the same day and same period with different lengths of data for the same step length with rolling mechanism

The same time period (18:00–19:25) of the same day (August 14) is selected for the 5-min traffic flow data, in which 18:00–19:05 and 18:00–19:10 are selected as the initial periods, with total lengths of 14 and 15, respectively. According to the modelling mechanism of the new model, the first 13 data and the first 14 data were selected, respectively, and the latter data are predicted. Based on the new information priority principle, this section describes the use of the rolling mechanism for modelling. After rolling three times to obtain two groups of data, each group undergoes optimization using PSO, and both groups produce results with a value of 2. The simulation and prediction errors for the two groups of data are calculated, and the results are shown in Tables 4, 5 and 6.

Table 4 Comparative analysis of simulation results and prediction effect of traffic flow model with rolling mechanism for initial period 18:00–19:05
Table 5 Comparative analysis of simulation results and prediction effect of traffic flow model with rolling mechanism for the initial period 18:00–19:10
Table 6 Comparison of different performance metrics in Case 2

Table 4 shows that the EEGM(n,1) model exhibits simulated MAPEs values of 9.4016%, 9.0939%, 8.8258%, and 6.8010% for the four time periods, 18:00–19:05, 18:05–19:10, 18:10–19:15, and 18:15–19:20, respectively, MAPEp values of 6.7093%, 2.5550%, 0.5969% and 0.4882%, and a MAPEp value after rolling three times of only 0.4882%. Table 6 shows that the CMRPE of the model has an error of only 3.6446% after rolling three times, which indicates high accuracy. Considering both the simulation error and prediction error, the model's error is smaller than that of the previous one every time it is rolled, which indicates that the model achieves high accuracy.

In addition to the comparison of the MAPE, comparing the trends of the prediction curves can also effectively reveal that the model exhibits high stability and prediction ability. Therefore, Fig. 3 depicts the simulated and predicted fitting curves for each of the four time periods. From the individual trend plots, the EEGM(n,1) model not only fits the original data better in the simulation stage but also exhibits the same performance as that in the prediction phase. Overall, the trend of the new model simulated from the first period to the fourth period increasingly approaches that of the original curve. In conclusion, the model adapts to the rolling prediction of traffic flow data better than the other models, which indicates that the EEGM(n,1) model has notable predictive efficacy.

Fig. 3
figure 3

Simulation and prediction of traffic flow data after rolling three times for the initial period 18:00–19:05

Table 5 shows that the new model yields simulated MAPEs values of 9.1974%, 8.5884%, 7.6210%, and 7.9597% in the four time periods, respectively, and the predicted MAPEp value has the smallest error of only 0.4665% after two rolling time periods. The simulated MAPEs value gradually decreases after three rolling cycles, although the simulation error after the third cycle is 0.3387% greater than that after the second cycle. However, overall, the results indicate that the model effectively predicts data under the rolling mechanism. Table 6 shows that the CMRPE values of the model are all less than 10%, with the best performance having an error of only 4.04375%. This result indicates the effective predictability of the new model on the data, and Fig. 4 is plotted to visualize the prediction performance of the rolling prediction mechanism.

Fig. 4
figure 4

Simulation and prediction of traffic flow data after rolling three times for the initial period 18:00–19:10

Figure 4 shows the simulated and predicted fitting curves for four time intervals: 18:00–19:10, 18:05–19:15, 18:10–19:20, and 18:20–19:25. It is intuitively shown from the figure that the EEGM(n,1) model captures the trend direction of the traffic flow dynamics, in which the best fitting effect is observed in third period, and in the fourth period from 18:30 onwards, the new model can fit the trend of the actual data of the traffic flow well. This trend is very close to that of the original data. These findings fully demonstrate that the model is suitable for trend simulation and prediction of the traffic flow system.

In comparing the two sets of data in Tables 4 and 5, two different sets of data from the same period are used to demonstrate that it is feasible to use the prediction with the rolling mechanism for the traffic flow data when the structure of the model is unchanged, and good results are obtained. In terms of the structure of the model, the optimal order corresponding to the two sets of data are \(2 - order\), which indicates that the model can stably predict the two sets of data with a rolling mechanism when the structure is unchanged. In terms of the modelling object, by keeping the initial time constant and changing the length of the modelling sequence, the model can also consistently and accurately predict two sets of data with the same step length. The new model can make stable predictions for different lengths of modelled sequences with the rolling mechanism.

5.4 Case 3: performance comparison of different models on the same day and period

The traffic flow data for the period 16:40–17:50 on August 14 are selected, and the total length of the data is 15. According to the modelling mechanism of the new model, the first 12 data are selected as the modelling data. The performance of the model was then evaluated using the next 3 data, which represent the following 15 min. The algorithm obtains the optimal order of 3 for this set of data, and the results are compared with those of the NGM(1,1), Verhulst, GM(2,1), WGM(1,1), CCRGM(1,1), and NGBM(1,1,k,c) models; additionally, a comparison of the prediction results of the seven models with the actual results is shown in Fig. 5. Three commonly used indicators, CMRPE, APE, and MAPE, are calculated to measure the prediction performance of the models. The results are presented in Tables 7, 8, and 9.

Fig. 5
figure 5

Simulation and prediction of traffic flow data for four different models in Case 3

Table 7 Comparison of Traffic Flow Model Predictions from 16:40–17:50
Table 8 Comparison of Traffic Flow Model Predictions for 16:40–17:50
Table 9 Comparison of performance metrics of different models in Case 3

For the case study of this section, the EEGM(n,1) model exhibits an error of 7.3959% in the modelling part, and its prediction accuracy is higher in the 12-time nodes of modelling; moreover, its accuracy is second only to that of the NGM(1,1) model and CCRGM(1,1) models, but it has the highest accuracy in the prediction part, with a value of only 4.7982%. As shown in Table 9, the CMRPE of the EEGM(n,1) model is 6.0970%, which is significantly lower than that of the other six models. The GM(2,1) model yields the lowest prediction accuracies in both the simulation and prediction parts. Although the NGM(1,1) model and the CCRGM(1,1) model yield high prediction accuracies when the data are simulated, the MAPEp values in the forecast part are significantly greater than those of the proposed model, with errors as high as 17.6868% and 15.9930%, respectively. The errors of the WGM(1,1) model and the NGBM(1,1,k,c) model are both more than 10% in both the simulation and prediction parts, which are much larger than those of the new model. In summary, the proposed EEGM(n,1) model achieves high prediction accuracy and exhibits good adaptability and applicability.

Since the error of the GM(2,1) model is too large and plotting affects the observation and comparison, only the curves of the remaining four models fit to the original data are plotted here, as shown in Fig. 5. The NGM(1,1) model shows almost no fluctuation, and the data show a gradual downwards trend that slowly deviates from that of the original data. The predicted curves of the Verhulst model are consistently below the original data curve, underestimating the values of the original data series and not matching the actual data trend fluctuations. Although the predicted curve of the WGM(1,1) model shows some fluctuations, it deviates far from the actual curve and does not comply with the fluctuation patterns of the original data. The prediction results of the CCRGM(1,1) model do not fluctuate much, exhibiting a relatively smooth trend. However, this smoothing trend can lead to the model failing to capture subtle changes and dynamics in the data. The NGBM(1,1,k,c) model has certain limitations when processing traffic flow data. The trend of the model is inconsistent with the fluctuation law of the actual traffic flow data, which shows that the prediction accuracy of the model in this time period is lacking. Considering the ability of the model to simulate the original data, the EEGM(n,1) model can effectively fit the actual traffic flow trend, reflecting the overall variation trend of traffic volume. This finding indicates that the model is adaptable to time series with fluctuations. Thus, the EEGM(n,1) model has the best goodness of fit of all the models.

5.5 Analysis of case results

In this section, the corresponding MAPEs, MAPEp, and CMRPE values for the three cases are given in Tables 3, 6, and 9, respectively, and the corresponding bar charts are plotted. As shown in Fig. 6, the corresponding errors of the EEGM(n,1) model in the three cases are less than 10%, which indicates that the model exhibits an accurate prediction effect. In Fig. 6a, the MAPEs, MAPEp, and CMRPE values of the two time periods do not differ much, and the CMRPE is less than 7%. In Fig. 6b, the MAPEs, MAPEp, and CMRPE values tend to decrease with increasing number of rolling times. Figure 6c shows a decreasing trend in the errors for the first three time periods, while the error slightly increases for the fourth period but remains stable at approximately 8%. Figure 6d, shows that the MAPEs, MAPEp, and CMRPE of the EEGM(n,1) model are the minimum of all seven models, and the errors are not as high as 8%.

Fig. 6
figure 6

Comparison of different evaluation indicators in the three cases

Due to the variable structure of the EEGM(n,1) model, we set up three cases from different perspectives. In Case 1, it is verified that under different model structures, two sets of data are predicted with the same step length, and the performance of the results indicates that the model exhibits a stable prediction effect. In Case 2, under the same model structure, three rolling predictions are made for data of different lengths at the same initial moment in the same period, which verifies that the model can accurately capture the characteristics of the traffic flow data and also provides stable predictions for simulated sequences of different lengths. Additionally, the use of a different rolling prediction method in Case 2 compared to Case 1 further highlights the ability of the EEGM(n,1) model to stably predict traffic flow data under different forecasting approaches. Case 3 verifies that the combined performance of the EEGM(n,1) model in the simulation and prediction phases is better than that of the other six models by comparing the EEGM(n,1) model with the NGM(1,1), Verhulst, GM(2,1), WGM(1,1), CCRGM(1,1), and NGBM(1,1,k,c) models. The results demonstrate the capability of the proposed model to capture future trends and develop data more effectively, making it more applicable.

Based on the three empirical case studies presented above, it can be inferred that models exhibit a generally high level of accuracy in simulating and predicting outcomes under various complex conditions, such as different model structures, data lengths, and forecasting methods. The new model achieves the best fitting performance and is a validated method for accurately predicting traffic flow trends with high fitting and prediction accuracy. The results show that the EEGM(n,1) model can simulate the fluctuating trend of traffic flow well and that the model has good adaptability to time series with fluctuations, conforms to the characteristics of trend changes in traffic flow data, and achieves good predictions of the direction and development trends of traffic flow in the future. Overall, the model is effective and reliable in predicting the accuracy of traffic flow data and can be used for practical applications.

6 Summary and outlook

In this paper, a high-order variable coefficient grey prediction model based on the Euler equation is established, beginning from the basic Euler equation in fluid mechanics. First, the introduction of the variable coefficient differential Euler equation makes the model more adaptable to the stochastic and nonlinear characteristics of traffic flow data and allows us to better explore the characteristics of traffic flow data over time. In addition, to improve the stability of the model structure, a linear correction term is included in the grey prediction model. Furthermore, a suitable time response function is constructed using the principle of grey differential information to eliminate errors between the differential function and the difference function. Finally, the particle swarm optimization algorithm is employed to optimize the new model, aiming to improve its accuracy.

Furthermore, in the first two cases of traffic flow on Canadian highways, the validation of the research results shows that the new model exhibits good adaptability and stability under complex situations involving different model structures, different data lengths, and different prediction methods and is suitable for predicting highway short-term traffic flow. The effectiveness of the EEGM(n,1) model is verified in the third case, which is based on data from traffic flow on Canadian highways. The results show that the simulation and prediction results of the new model are better than those of other grey models, including the NGM(1,1), Verhulst, GM(2,1), WGM(1,1), CCRGM(1,1), and NGBM(1,1,k,c) models. The new model can effectively capture the fluctuation patterns in highway traffic flow data, exhibiting good stability and prediction accuracy in both fitting and prediction. The proposed prediction model in this study can assist decision-makers in obtaining a better understanding of short-term traffic variations on highways, providing theoretical support for short-term highway prediction and offering scientific evidence for alleviating highway traffic congestion.

Although the proposed grey prediction model based on the Euler equations has obvious advantages, there is still room for improvement. To apply this model to more complex traffic flow systems, considering that a variety of external factors, such as speed limits, accidents, weather, and special dates, can affect the prediction of traffic flow, we will further investigate the addition of these external factors to the model to increase the complexity of the current traffic flow prediction model and construct an accurate short-term traffic flow prediction model.