# ARIMA Model-Based Fire Rescue Prediction

Authors: Xinchen Zhang; Qincheng Zhou; Shijie Weng; Hui Zhang
Journal: Scientific Programming
 (2021)

---

## Abstract

In recent years, urban buildings have become taller, occupying more and more areas, frequent fires, and increasingly difficult fire rescue tasks. Predicting fire risks in advance will help fire rescue work. Therefore, this paper proposes a fire risk prediction based on the ARIMA model. By analyzing the fire rescue data of a certain place from 2016 to 2020 and based on the data from January 1, 2016, to December 31, 2019, an ARIMA model for predicting the number of fire rescue polices was established. The data from January 1, 2020, to December 31, 2020, are used as the validation data set of the model to evaluate the accuracy and stability of the model. The results show that the ARIMA model can be better applied to fire rescue prediction and provides a scientific prediction method for the research of smart fire rescue work.


---

## Body

## 1. Introduction

With the rapid development of our country’s economy, the environmental complexity has risen sharply, various accidents and disasters have occurred frequently, and safety risks have continued to increase. The challenges of fire prevention, control, firefighting, and rescue problems such as physical, underground engineering, and large chemical companies will be even more severe. Smart fire rescue is an important part of the construction of smart cities. It is necessary to actively apply new technologies such as artificial intelligence [1, 2], big data [3, 4], cloud computing, Internet of Things [5, 6], and geographic information to establish a smart fire rescue system [7,8] to realize the identification and early warning of disaster occurrence patterns and risks, real-time monitoring of disaster information, intelligent remote monitoring of firefighting facilities, intelligent deployment of rescuers, and so on to build an unbreakable line of fire safety defense for the construction of smart cities. At the same time, with the rapid expansion of the city, the number and density of urban buildings are growing at a high rate. The complex function and structure of modern urban buildings bring a great difficulty to fire control. Efficient and safe building fire emergency rescue is a problem that needs to be solved urgently. Although in the past many experts and scholars have paid attention to how to improve the city’s fire emergency rescue capabilities, it is a pity that the iteration speed of fire emergency rescue methods is still far behind the development speed of urban buildings. At present, the fire department’s assessment of unit fire risk still depends on the experience of firefighters, which has great subjective uncertainty. Therefore, it is necessary to adopt a more general scientific method to assess the risk of fire. At the same time, local fire departments have stored a large amount of relevant data in fire protection practice, including fire rescue data, fire inspection data, basic information data of related units, and urban building data. To deeply analyze the historical data of fire protection and obtain the information hidden behind the data through technical means, so as to support the accuracy of the desired target, it is necessary to use reasonable methods and tools to process the data. Machine learning technology is an efficient method to obtain effective information through data cleaning, reasonable feature construction, learning, and training from databases, texts, data warehouses, and other information bases.The ARIMA model was proposed by American statistician Jenkins and British statistician box in the 1970s. The ARIMA model is mainly used in the short-term prediction of time series variables. The single time series value is unpredictable, but the overall time series value has a certain law. The ARIMA model expresses this rule in mathematical form to realize the short-term prediction of time series value.To predict the fire risk more accurately, this paper proposes a fire risk prediction and analysis method based on the ARIMA model. The time series analysis method is used to observe the changing trend of the number of fire rescue in a certain interval, mine the rule from the data, and predict the number of fire rescue alarms in the future. The significance of our work is as follows. (1) This paper proposes a fire risk prediction and analysis method based on the ARIMA model. By analyzing the fire and rescue data of a certain place, an ARIMA model is established to predict the number of times of fire and rescue police. (2) The ARIMA model has a simple structure and few parameters, and only endogenous variables are needed to build a predictive model. The model predicts the number of times of fire and rescue police iteratively, which is conducive to better mining the factors that affect the number of fire rescue police and the evolution trajectory. (3) The results show that the ARIMA model can be better applied to fire rescue prediction and provides a scientific prediction method for the research of smart fire rescue work.


## 2. Introduction to Fire Risk Prediction and Analysis Methods

The ability to predict fire risk [9, 10] is an important aspect of smart fire rescue. Time series forecasting, neural network, and polynomial fitting are some of the most commonly used methods for predicting and analyzing fire risks. However, assessing such multivariate environmental disasters has always been difficult because modeling can be skewed by a variety of factors, including the quality and quantity of input parameters, the training process, and hyperparameter default settings.


### 2.1. Time Series Analysis

A time series is a collection of observations derived from the progression of time, which is essentially the dependence of adjacent observations. Analyzing time series data allows researchers to determine the system’s internal evolution law, as well as observe and predict the system’s future development trend [11]. For example, Qiu Jie et al. [12] used Landsat time series data and machine learning methods to conduct quantitative research on forest fires and postdisaster vegetation restoration in the Daxinganling area, drawing a forest distribution map 1987–2016 disturbances in the Daxinganling area using the vegetation change tracking (VCT) algorithm. The VCT Block separates the burning points from the disturbance patches using the vector machine (SVM) classifier and historical fire records. The results show that VCT’s forest interference events have high spatial precision. Most years have between 70% and 86 percent spatial accuracy. The proposed VCT-SVM algorithm extracts annual fire patches with an overall accuracy rate of 92%. The RF algorithm’s prediction accuracy is better than that of SVM and SMLR according to the verification results. Gao Natekar et al. [13] investigated the use of long- and short-term memory neural networks to predict the spread of forest fires. In the northern beaches of Sydney, Naderpour Mohsen et al. [14] proposed a spatial framework for quantifying the risk of forest fires. In order to maximize the impact of multilayer perceptrons on forests, 36 key indicators from various backgrounds, such as terrain, form, climate, man-made, social, and physical, were selected and used as input to the model. The model can be tailored to different parts of Australia and has fewer requirements for weighting procedure localization, enhancing adaptability and decision-making ability.


### 2.2. ARIMA Model

The modeling of the ARIMA model can be divided into the following four steps. First, the stationarity test is performed on the original sequence. If the test result is not stable, it is necessary to make the sequence meet the stationarity conditions through differential changes or other changes. Second, the model is determined by calculating the statistics describing the characteristics of the sequence, and the order of the model is determined by combining certain criterion. Third, the parameters of the model are estimated, such as by the least square method, and the rationality test is carried out. Finally, the diagnostic analysis is carried out, the data are predicted through the generated model, and the actual data are compared with it for the prediction accuracy determination test. If the parameters are not determined accurately, a new model is established again.


### 2.3. Polynomial Fitting

Polynomial fitting is to use a polynomial expansion to fit all observation points in an analysis area containing several analysis grid points to obtain the objective analysis field of the observation data, and the expansion coefficient is determined by least square fitting [15]. Mei Peng et al. [16] proposed a rapid loss assessment network analysis method (ANP) for high casualties fires, established a context index (SI) and outcome index (CI) network, and compared ANP and multiple logistic regression. The correct classification rate of the accident level is directly related to the multilayer perceptron network and the radial basis function network. The findings show that ANP excels at high and extreme levels, as well as when accident levels are taken into account. Weighted least squares polynomial fitting is used to generate meaningful extreme possibility results for decision-making reference, and it can be used to obtain the relationship between the context index (SI) and the outcome index (CI) of high-level and extreme HCFs. To investigate the impact of temperature on the frequency of fires in Changsha, Liu Dingli et al. [17] collected and processed 20,622 fire data as well as historical weather data in Changsha. Data mining reveals that the average daily fire frequency is lowest in the temperature range of 20 °C and 25 °C, which is likely due to the low power utilization rate. The lowest daily temperature predicts better performance than the highest daily temperature, according to polynomial fitting.


## 2.1. Time Series Analysis

A time series is a collection of observations derived from the progression of time, which is essentially the dependence of adjacent observations. Analyzing time series data allows researchers to determine the system’s internal evolution law, as well as observe and predict the system’s future development trend [11]. For example, Qiu Jie et al. [12] used Landsat time series data and machine learning methods to conduct quantitative research on forest fires and postdisaster vegetation restoration in the Daxinganling area, drawing a forest distribution map 1987–2016 disturbances in the Daxinganling area using the vegetation change tracking (VCT) algorithm. The VCT Block separates the burning points from the disturbance patches using the vector machine (SVM) classifier and historical fire records. The results show that VCT’s forest interference events have high spatial precision. Most years have between 70% and 86 percent spatial accuracy. The proposed VCT-SVM algorithm extracts annual fire patches with an overall accuracy rate of 92%. The RF algorithm’s prediction accuracy is better than that of SVM and SMLR according to the verification results. Gao Natekar et al. [13] investigated the use of long- and short-term memory neural networks to predict the spread of forest fires. In the northern beaches of Sydney, Naderpour Mohsen et al. [14] proposed a spatial framework for quantifying the risk of forest fires. In order to maximize the impact of multilayer perceptrons on forests, 36 key indicators from various backgrounds, such as terrain, form, climate, man-made, social, and physical, were selected and used as input to the model. The model can be tailored to different parts of Australia and has fewer requirements for weighting procedure localization, enhancing adaptability and decision-making ability.


## 2.2. ARIMA Model

The modeling of the ARIMA model can be divided into the following four steps. First, the stationarity test is performed on the original sequence. If the test result is not stable, it is necessary to make the sequence meet the stationarity conditions through differential changes or other changes. Second, the model is determined by calculating the statistics describing the characteristics of the sequence, and the order of the model is determined by combining certain criterion. Third, the parameters of the model are estimated, such as by the least square method, and the rationality test is carried out. Finally, the diagnostic analysis is carried out, the data are predicted through the generated model, and the actual data are compared with it for the prediction accuracy determination test. If the parameters are not determined accurately, a new model is established again.


## 2.3. Polynomial Fitting

Polynomial fitting is to use a polynomial expansion to fit all observation points in an analysis area containing several analysis grid points to obtain the objective analysis field of the observation data, and the expansion coefficient is determined by least square fitting [15]. Mei Peng et al. [16] proposed a rapid loss assessment network analysis method (ANP) for high casualties fires, established a context index (SI) and outcome index (CI) network, and compared ANP and multiple logistic regression. The correct classification rate of the accident level is directly related to the multilayer perceptron network and the radial basis function network. The findings show that ANP excels at high and extreme levels, as well as when accident levels are taken into account. Weighted least squares polynomial fitting is used to generate meaningful extreme possibility results for decision-making reference, and it can be used to obtain the relationship between the context index (SI) and the outcome index (CI) of high-level and extreme HCFs. To investigate the impact of temperature on the frequency of fires in Changsha, Liu Dingli et al. [17] collected and processed 20,622 fire data as well as historical weather data in Changsha. Data mining reveals that the average daily fire frequency is lowest in the temperature range of 20 °C and 25 °C, which is likely due to the low power utilization rate. The lowest daily temperature predicts better performance than the highest daily temperature, according to polynomial fitting.


## 3. Fire Rescue Prediction Based on ARIMA Model

### 3.1. Data Sources

This paper uses the situation of fire rescue police in a certain place from 2016 to 2020 as the data source. The calculation process is based on the data of that place from January 1, 2016, to December 31, 2019, and the number of fire rescue police is established by month. Predictive model uses the data from January 1, 2020, to December 31, 2020, as the model’s verification data set, evaluates the accuracy and stability of the model, and predicts the number of fire rescue alarms in each month of 2021. The situation of fire and rescue police from 2016 to 2020 is shown in Table1.Table 1
The situation of fire rescue police from 2016 to 2020 (unit: times).
Jan.Feb.Mar.Apr.MayJun.Jul.Aug.Sep.Oct.Nov.Dec.201679959851275676340503138432017582844141488723424933656820185412968711071195950464440632019677673441381467230412625362020282328466255252936255162


### 3.2. The Proposed Modeling for Fire Rescue Prediction

#### 3.2.1. The Procedure of ARIMA Model

In our study, we use the ARIMA model for fire rescue prediction. The prerequisite for the establishment of the ARIMA model is that the time series are required to have stationarity. It can be judged intuitively by making the original sequence diagram, and the stationarity of the sequence can also be verified by the inspection method. If the sequence is not stable, one can use data transformation or difference to make the data stable. Combined with the data stabilization processing, the autocorrelation (ACF) diagram and partial correlation (PACF) diagram are drawn for the sequences that meet the stability requirements after preprocessing, and the model is preliminarily identified and ranked according to the tail-cutting or tailing of the ACF diagram and PACF diagram. If the ACF graph is tailing and the PACF graph is tail-cutting, the AR(p) model is applicable, and the value of PACF tail-cutting is the p value. Otherwise, the MA(q) model is selected, and the tail-cutting value of the ACF graph is the q value. If both ACF and PACF graphs are tailed, one can consider the ARIMA(p, d, q) model. Generally, a method of gradually trying from low order to high order is adopted. The next step is the fitting of the ARIMA function. The optimal model is tested to see whether there is a correlation between residuals. Then, the optimal model is used to predict the historical data. Finally, the optimal model is used for prediction.From the historical data in Table1, it can be seen that in order to predict the number of fire rescue polices in 2021, a fitting relationship between the numbers of polices and time should be established.At present, the classic time series forecasting models include the ARIMA model, regression model, time convolutional network, and gray model. We use the ARIMA algorithm in this study. The ARIMA algorithm is one of the main tools for linear time series forecasting [18]. It takes the time data sequence of the prediction object as a random sequence for difference and smoothing and then uses a mathematical model to approximate the sequence to predict the future value of the time sequence.The ARIMA model is a time series combination model that combines the autoregressive process (AR) and the moving average process (MA), written asARIMAp,d,q. P is the lag order of the autoregressive process, d is the lag order of the time series, and q is the lag order of the moving average process. The linear equation is as follows:(1)xi=c+∑i=0pϕixi−1+εi+∑i=0qθiεi−1,where xi is a stationary variable, c is a constant, ϕi(ϕi≠0) is the coefficient of the coefficient xi−1,xi−2,...,xi−pof the autoregressive lag term, and εi is the residual. It is assumed that the residual sequence is a Gaussian white noise sequence. θi (θi≠0) is the coefficient of the moving average lag term εi−1,εi−2,...,εi−q.


#### 3.2.2. Data Stability Analysis and Processing

LetXt be the time series data of the number of alarms. From the time series diagram (Figure 1), it can be seen that the values of each series fluctuate up and down along a straight line, but the fluctuation range is very irregular, so it is a nonstationary time series. First, Xt is smoothed to obtain the stationary time series Zt, the statistical characteristics of the sequence Zt are judged, and the stationary time series model required for the modeling sequence Zt is determined. By calculating the ACF and PACF of the time series Zt, the time series model required for the modeling sequence Zt is determined. The ACF and PACF diagrams of the sequence Zt are shown in Figures 2 and 3.Figure 1
Time series chart distributed by month.Figure 2
Autocorrelation function of sequenceZt.Figure 3
Partial autocorrelation function of sequenceZt.It can be seen from Figure3 that the ACF of the sequence Zt always fluctuates around zero, rather than tending to zero. The ACF of the sequence Zt does not have tail-cutting properties and has tailing properties. In Figure 3, the PACF value of the sequence Zt always fluctuates around the zero value; instead of tending to zero at a certain moment, it also has a tailing property. Both of these functions have tailing properties, which are consistent with the characteristics of the ARIMA model [19].


#### 3.2.3. Significance Test of Model Order and Parameters

After completing the stationary sequence, since the nonstationary sequence becomes a stationary sequence after k-th difference is completed, it obeys the ARMA(p, q) model, so the order is determined. Commonly used methods of order determination include F-test order determination method, residual variance graph order determination method, and function criterion order determination method [20]. The function criterion order determination method is to determine the order of the model by defining a criterion function. At present, there are Akaike information criterion (AIC) guidelines and BIC guidelines in the mainstream. For the ARMA (n, m) model, the calculation equation of the AIC quasi-measurement function is as follows:(2)AICn,m=Inσ2+2n+mN,where n and m, respectively, model the autoregressive and moving average partial orders of ARMA, N is the number of sequence values, and σ2 is the estimated value of noise variance in the model. The sequence Xt is smoothed to get the sequence Zt, and the order is determined by the AIC criterion. For a stationary time series Zt, the order of ARMAn,m describing the sequence Zt is determined by comparing the AIC values of different models; that is, the autoregressive order n and the moving average order m in the model are determined. For a sequence Zt with 48 data, the corresponding model AIC value is calculated by the above formula. For the model ARMA n,m, the upper and lower limits of n and m are determined, that is, the range of values for n and m. Generally, the lower limit is 1, and the upper limit is 1/10 of the number N of values in the sequence. Therefore, the lower limit of n and m is 1, and the upper limit is 5. It can be obtained that n and m have a total of 5×5 = 25 combinations of values, so there are a total of 25 AIC values. See Table 2 for details.Table 2
AIC value.
No.AICNo.AIC17.4735147.708027.5278156.900137.5833167.617447.6311177.197156.9879187.744867.5249197.959777.5584206.851087.6320216.920897.6152226.9572107.2433236.8995117.6021246.8006127.5797256.7066137.6703Through Matlab calculation, it is found that the minimum AIC value is AICmin = 6.7066. At this time, the corresponding ordersn and m of the ARMA model are both 5. Therefore, the final selection model is ARMA (5, 5). According to the calculation, the number of differences k=1.


### 3.3. ARIMA Model Analysis and Forecast

The application uses ARIMA (5,1,5) to model the sequenceZt, and the fitting is shown in Figure 4.Figure 4
Schematic diagram of ARIMA(5,1,5) model fitting (blue line represents the actual value, and red line represents the predicted value).In Figure4, the trends of peaks and valleys fit more closely, so a rough forecast can be given. When evaluating the accuracy of the model using 12 data in 2020, an error analysis chart (Figure 5) and the error analysis table (Table 3) are listed.Figure 5
Error analysis.Table 3
Error analysis.
Month in 2020ARIMATrueAbsolute error (%)Jan.30287.1Feb.362356.5Mar.332817.8Apr.534615.2May56629.6Jun.58555.4Jul.5925136Aug.29290Sep.483633.2Oct.222512Nov.205160.7Dec.456227.4Because there are many causes of accidents and disasters, the randomness is extremely large, so there is no complete law to follow. Therefore, the data given are very volatile, and the regularity is very weak. It is difficult to establish the prediction model itself. Therefore, when the ARIMA model gives data, the forecast in a certain few months may be very inaccurate (as in July 2020 in the above table). However, in general, the error has been small, the model is still more successful, and the accuracy is high.In the stability check, several larger parameters were modified, and the excessively large parameters were reduced to a large extent. After changing the data, it is found that within the scope of 2020, the change in the fitted image is not very large (see Figure6). Therefore, this algorithm can guarantee certain stability in practical applications. When the parameters change within a certain range, the ARIMA algorithm can ensure that the sensitivity is not too high. The result will not change much. Table 4 shows the forecast results of the number of fire rescue police in each month of 2021.Figure 6
ARIMA model stability test results (blue line represents the samples from 2020, and red line represents the samples from 2021).Table 4
Forecast of the number of fire and rescue police in each month of 2021.
MonthJan.Feb.Mar.Apr.MayJun.Jul.Aug.Sep.Oct.Nov.Dec.Forecast value/time324859456131352416312840


## 3.1. Data Sources

This paper uses the situation of fire rescue police in a certain place from 2016 to 2020 as the data source. The calculation process is based on the data of that place from January 1, 2016, to December 31, 2019, and the number of fire rescue police is established by month. Predictive model uses the data from January 1, 2020, to December 31, 2020, as the model’s verification data set, evaluates the accuracy and stability of the model, and predicts the number of fire rescue alarms in each month of 2021. The situation of fire and rescue police from 2016 to 2020 is shown in Table1.Table 1
The situation of fire rescue police from 2016 to 2020 (unit: times).
Jan.Feb.Mar.Apr.MayJun.Jul.Aug.Sep.Oct.Nov.Dec.201679959851275676340503138432017582844141488723424933656820185412968711071195950464440632019677673441381467230412625362020282328466255252936255162


## 3.2. The Proposed Modeling for Fire Rescue Prediction

### 3.2.1. The Procedure of ARIMA Model

In our study, we use the ARIMA model for fire rescue prediction. The prerequisite for the establishment of the ARIMA model is that the time series are required to have stationarity. It can be judged intuitively by making the original sequence diagram, and the stationarity of the sequence can also be verified by the inspection method. If the sequence is not stable, one can use data transformation or difference to make the data stable. Combined with the data stabilization processing, the autocorrelation (ACF) diagram and partial correlation (PACF) diagram are drawn for the sequences that meet the stability requirements after preprocessing, and the model is preliminarily identified and ranked according to the tail-cutting or tailing of the ACF diagram and PACF diagram. If the ACF graph is tailing and the PACF graph is tail-cutting, the AR(p) model is applicable, and the value of PACF tail-cutting is the p value. Otherwise, the MA(q) model is selected, and the tail-cutting value of the ACF graph is the q value. If both ACF and PACF graphs are tailed, one can consider the ARIMA(p, d, q) model. Generally, a method of gradually trying from low order to high order is adopted. The next step is the fitting of the ARIMA function. The optimal model is tested to see whether there is a correlation between residuals. Then, the optimal model is used to predict the historical data. Finally, the optimal model is used for prediction.From the historical data in Table1, it can be seen that in order to predict the number of fire rescue polices in 2021, a fitting relationship between the numbers of polices and time should be established.At present, the classic time series forecasting models include the ARIMA model, regression model, time convolutional network, and gray model. We use the ARIMA algorithm in this study. The ARIMA algorithm is one of the main tools for linear time series forecasting [18]. It takes the time data sequence of the prediction object as a random sequence for difference and smoothing and then uses a mathematical model to approximate the sequence to predict the future value of the time sequence.The ARIMA model is a time series combination model that combines the autoregressive process (AR) and the moving average process (MA), written asARIMAp,d,q. P is the lag order of the autoregressive process, d is the lag order of the time series, and q is the lag order of the moving average process. The linear equation is as follows:(1)xi=c+∑i=0pϕixi−1+εi+∑i=0qθiεi−1,where xi is a stationary variable, c is a constant, ϕi(ϕi≠0) is the coefficient of the coefficient xi−1,xi−2,...,xi−pof the autoregressive lag term, and εi is the residual. It is assumed that the residual sequence is a Gaussian white noise sequence. θi (θi≠0) is the coefficient of the moving average lag term εi−1,εi−2,...,εi−q.


### 3.2.2. Data Stability Analysis and Processing

LetXt be the time series data of the number of alarms. From the time series diagram (Figure 1), it can be seen that the values of each series fluctuate up and down along a straight line, but the fluctuation range is very irregular, so it is a nonstationary time series. First, Xt is smoothed to obtain the stationary time series Zt, the statistical characteristics of the sequence Zt are judged, and the stationary time series model required for the modeling sequence Zt is determined. By calculating the ACF and PACF of the time series Zt, the time series model required for the modeling sequence Zt is determined. The ACF and PACF diagrams of the sequence Zt are shown in Figures 2 and 3.Figure 1
Time series chart distributed by month.Figure 2
Autocorrelation function of sequenceZt.Figure 3
Partial autocorrelation function of sequenceZt.It can be seen from Figure3 that the ACF of the sequence Zt always fluctuates around zero, rather than tending to zero. The ACF of the sequence Zt does not have tail-cutting properties and has tailing properties. In Figure 3, the PACF value of the sequence Zt always fluctuates around the zero value; instead of tending to zero at a certain moment, it also has a tailing property. Both of these functions have tailing properties, which are consistent with the characteristics of the ARIMA model [19].


### 3.2.3. Significance Test of Model Order and Parameters

After completing the stationary sequence, since the nonstationary sequence becomes a stationary sequence after k-th difference is completed, it obeys the ARMA(p, q) model, so the order is determined. Commonly used methods of order determination include F-test order determination method, residual variance graph order determination method, and function criterion order determination method [20]. The function criterion order determination method is to determine the order of the model by defining a criterion function. At present, there are Akaike information criterion (AIC) guidelines and BIC guidelines in the mainstream. For the ARMA (n, m) model, the calculation equation of the AIC quasi-measurement function is as follows:(2)AICn,m=Inσ2+2n+mN,where n and m, respectively, model the autoregressive and moving average partial orders of ARMA, N is the number of sequence values, and σ2 is the estimated value of noise variance in the model. The sequence Xt is smoothed to get the sequence Zt, and the order is determined by the AIC criterion. For a stationary time series Zt, the order of ARMAn,m describing the sequence Zt is determined by comparing the AIC values of different models; that is, the autoregressive order n and the moving average order m in the model are determined. For a sequence Zt with 48 data, the corresponding model AIC value is calculated by the above formula. For the model ARMA n,m, the upper and lower limits of n and m are determined, that is, the range of values for n and m. Generally, the lower limit is 1, and the upper limit is 1/10 of the number N of values in the sequence. Therefore, the lower limit of n and m is 1, and the upper limit is 5. It can be obtained that n and m have a total of 5×5 = 25 combinations of values, so there are a total of 25 AIC values. See Table 2 for details.Table 2
AIC value.
No.AICNo.AIC17.4735147.708027.5278156.900137.5833167.617447.6311177.197156.9879187.744867.5249197.959777.5584206.851087.6320216.920897.6152226.9572107.2433236.8995117.6021246.8006127.5797256.7066137.6703Through Matlab calculation, it is found that the minimum AIC value is AICmin = 6.7066. At this time, the corresponding ordersn and m of the ARMA model are both 5. Therefore, the final selection model is ARMA (5, 5). According to the calculation, the number of differences k=1.


## 3.2.1. The Procedure of ARIMA Model

In our study, we use the ARIMA model for fire rescue prediction. The prerequisite for the establishment of the ARIMA model is that the time series are required to have stationarity. It can be judged intuitively by making the original sequence diagram, and the stationarity of the sequence can also be verified by the inspection method. If the sequence is not stable, one can use data transformation or difference to make the data stable. Combined with the data stabilization processing, the autocorrelation (ACF) diagram and partial correlation (PACF) diagram are drawn for the sequences that meet the stability requirements after preprocessing, and the model is preliminarily identified and ranked according to the tail-cutting or tailing of the ACF diagram and PACF diagram. If the ACF graph is tailing and the PACF graph is tail-cutting, the AR(p) model is applicable, and the value of PACF tail-cutting is the p value. Otherwise, the MA(q) model is selected, and the tail-cutting value of the ACF graph is the q value. If both ACF and PACF graphs are tailed, one can consider the ARIMA(p, d, q) model. Generally, a method of gradually trying from low order to high order is adopted. The next step is the fitting of the ARIMA function. The optimal model is tested to see whether there is a correlation between residuals. Then, the optimal model is used to predict the historical data. Finally, the optimal model is used for prediction.From the historical data in Table1, it can be seen that in order to predict the number of fire rescue polices in 2021, a fitting relationship between the numbers of polices and time should be established.At present, the classic time series forecasting models include the ARIMA model, regression model, time convolutional network, and gray model. We use the ARIMA algorithm in this study. The ARIMA algorithm is one of the main tools for linear time series forecasting [18]. It takes the time data sequence of the prediction object as a random sequence for difference and smoothing and then uses a mathematical model to approximate the sequence to predict the future value of the time sequence.The ARIMA model is a time series combination model that combines the autoregressive process (AR) and the moving average process (MA), written asARIMAp,d,q. P is the lag order of the autoregressive process, d is the lag order of the time series, and q is the lag order of the moving average process. The linear equation is as follows:(1)xi=c+∑i=0pϕixi−1+εi+∑i=0qθiεi−1,where xi is a stationary variable, c is a constant, ϕi(ϕi≠0) is the coefficient of the coefficient xi−1,xi−2,...,xi−pof the autoregressive lag term, and εi is the residual. It is assumed that the residual sequence is a Gaussian white noise sequence. θi (θi≠0) is the coefficient of the moving average lag term εi−1,εi−2,...,εi−q.


## 3.2.2. Data Stability Analysis and Processing

LetXt be the time series data of the number of alarms. From the time series diagram (Figure 1), it can be seen that the values of each series fluctuate up and down along a straight line, but the fluctuation range is very irregular, so it is a nonstationary time series. First, Xt is smoothed to obtain the stationary time series Zt, the statistical characteristics of the sequence Zt are judged, and the stationary time series model required for the modeling sequence Zt is determined. By calculating the ACF and PACF of the time series Zt, the time series model required for the modeling sequence Zt is determined. The ACF and PACF diagrams of the sequence Zt are shown in Figures 2 and 3.Figure 1
Time series chart distributed by month.Figure 2
Autocorrelation function of sequenceZt.Figure 3
Partial autocorrelation function of sequenceZt.It can be seen from Figure3 that the ACF of the sequence Zt always fluctuates around zero, rather than tending to zero. The ACF of the sequence Zt does not have tail-cutting properties and has tailing properties. In Figure 3, the PACF value of the sequence Zt always fluctuates around the zero value; instead of tending to zero at a certain moment, it also has a tailing property. Both of these functions have tailing properties, which are consistent with the characteristics of the ARIMA model [19].


## 3.2.3. Significance Test of Model Order and Parameters

After completing the stationary sequence, since the nonstationary sequence becomes a stationary sequence after k-th difference is completed, it obeys the ARMA(p, q) model, so the order is determined. Commonly used methods of order determination include F-test order determination method, residual variance graph order determination method, and function criterion order determination method [20]. The function criterion order determination method is to determine the order of the model by defining a criterion function. At present, there are Akaike information criterion (AIC) guidelines and BIC guidelines in the mainstream. For the ARMA (n, m) model, the calculation equation of the AIC quasi-measurement function is as follows:(2)AICn,m=Inσ2+2n+mN,where n and m, respectively, model the autoregressive and moving average partial orders of ARMA, N is the number of sequence values, and σ2 is the estimated value of noise variance in the model. The sequence Xt is smoothed to get the sequence Zt, and the order is determined by the AIC criterion. For a stationary time series Zt, the order of ARMAn,m describing the sequence Zt is determined by comparing the AIC values of different models; that is, the autoregressive order n and the moving average order m in the model are determined. For a sequence Zt with 48 data, the corresponding model AIC value is calculated by the above formula. For the model ARMA n,m, the upper and lower limits of n and m are determined, that is, the range of values for n and m. Generally, the lower limit is 1, and the upper limit is 1/10 of the number N of values in the sequence. Therefore, the lower limit of n and m is 1, and the upper limit is 5. It can be obtained that n and m have a total of 5×5 = 25 combinations of values, so there are a total of 25 AIC values. See Table 2 for details.Table 2
AIC value.
No.AICNo.AIC17.4735147.708027.5278156.900137.5833167.617447.6311177.197156.9879187.744867.5249197.959777.5584206.851087.6320216.920897.6152226.9572107.2433236.8995117.6021246.8006127.5797256.7066137.6703Through Matlab calculation, it is found that the minimum AIC value is AICmin = 6.7066. At this time, the corresponding ordersn and m of the ARMA model are both 5. Therefore, the final selection model is ARMA (5, 5). According to the calculation, the number of differences k=1.


## 3.3. ARIMA Model Analysis and Forecast

The application uses ARIMA (5,1,5) to model the sequenceZt, and the fitting is shown in Figure 4.Figure 4
Schematic diagram of ARIMA(5,1,5) model fitting (blue line represents the actual value, and red line represents the predicted value).In Figure4, the trends of peaks and valleys fit more closely, so a rough forecast can be given. When evaluating the accuracy of the model using 12 data in 2020, an error analysis chart (Figure 5) and the error analysis table (Table 3) are listed.Figure 5
Error analysis.Table 3
Error analysis.
Month in 2020ARIMATrueAbsolute error (%)Jan.30287.1Feb.362356.5Mar.332817.8Apr.534615.2May56629.6Jun.58555.4Jul.5925136Aug.29290Sep.483633.2Oct.222512Nov.205160.7Dec.456227.4Because there are many causes of accidents and disasters, the randomness is extremely large, so there is no complete law to follow. Therefore, the data given are very volatile, and the regularity is very weak. It is difficult to establish the prediction model itself. Therefore, when the ARIMA model gives data, the forecast in a certain few months may be very inaccurate (as in July 2020 in the above table). However, in general, the error has been small, the model is still more successful, and the accuracy is high.In the stability check, several larger parameters were modified, and the excessively large parameters were reduced to a large extent. After changing the data, it is found that within the scope of 2020, the change in the fitted image is not very large (see Figure6). Therefore, this algorithm can guarantee certain stability in practical applications. When the parameters change within a certain range, the ARIMA algorithm can ensure that the sensitivity is not too high. The result will not change much. Table 4 shows the forecast results of the number of fire rescue police in each month of 2021.Figure 6
ARIMA model stability test results (blue line represents the samples from 2020, and red line represents the samples from 2021).Table 4
Forecast of the number of fire and rescue police in each month of 2021.
MonthJan.Feb.Mar.Apr.MayJun.Jul.Aug.Sep.Oct.Nov.Dec.Forecast value/time324859456131352416312840


## 4. Conclusion

This paper analyzes the fire rescue data from 2016 to 2020, uses the ARIMA algorithm to establish a predictive model of the number of fire rescue polices, uses the 2020 data for proofreading and analysis, and finally predicts the monthly number of police fires in 2021. This method only needs endogenous variables and not other exogenous variables and has strong operability and high accuracy. Through verification, the ARIMA model can better predict the number of fire rescue alarms. However, our ARIMA model also has several shortcomings. First, in our model, the future value of the sequence variable is assumed to satisfy the linear function relationship between the past observation value of the variable and the random error value. Since most time series contain nonlinearity, there are great limitations in the application of the ARIMA method in practical economic field. Second, the training of the ARIMA model requires enough historical data. These are the directions of our research work in the next stage.



---

*Source: 3212138-2021-10-22.xml*