## 3 Materials and Methods
### Methods
#### 3.3.3 LSTM and GARCH Family Combined Models  
The LSTM model and the GARCH-family models have their advantages in time series data prediction. The LSTM model focuses on capturing the time series features and nonlinear features of the series, whereas the GARCH-family model focuses on analyzing the series from a statistical perspective. To better exploit the garlic-price series' characteristics and improve the model's prediction accuracy, this paper explores garlic-price-prediction methods that combine of deep-learning models and econometric models. The specific approach of the combined LSTM-GARCH-family models is as follows.  
Different GARCH-family models can capture different information about the economic characteristics of price series. The GARCH, EGARCH, and PGARCH can be used to obtain the characteristics of volatility aggregation and persistence, asymmetric volatility, and enhanced asymmetric volatility flexibility of the series. In the GARCH model, the ARCH term coefficients represent the magnitude of volatility shocks and the GARCH term coefficients represent the persistence of volatility. In the EGARCH model, the leverage coefficient is used to measure the asymmetry of information. When it is positive, it indicates that positive market disturbances cause greater shocks to the volatility of the garlic market  
Figure 2: GARCH-family modeling flowchart.  
than negative disturbances. If it is negative, it indicates that negative market disturbances cause greater shocks to the volatility of the garlic market than positive disturbances. In the PGARCH model, the asymmetric description of serial volatility is represented by the asymmetric effect coefficient. In the combined model, historical prices and the parameters of GARCH-family models, which contain the information of sequence characteristics, are used as the feature inputs of the LSTM model. The combined model can learn more about price fluctuations by introducing statistical features into deep-learning models. Thus, the prediction performance of a combined model can be improved. The LSTM layers in the combined model are used to remember the critical information and forget the unimportant information. When the number of LSTM layers is small, the model has a poor ability to fit the nonlinearity of fluctuating features; when the number of layers is large, the training time is too long and the overfitting phenomenon easily occurs. Based on this, we finally built a stacked LSTM model after several experimental tests, choosing two LSTM layers for fitting the nonlinear features of the sequence and two fully connected layers for data dimensionality reduction, which can take less time to obtain better prediction results on our dataset. Figure 3 shows the structure of an LSTM-GARCH family combined model in this paper.  
Given a current time node, the objective of the LSTM-GARCH family combined model is to predict the garlic price at the current time node based on the historical data for the 50 days prior to that time node. LSTM-GARCH first extracts the volatility feature information from the historical garlic price data using GARCH, EGARCH, and PGARCH. Then, the parameters of GARCH, EGARCH, and PGARCH terms containing volatility feature information for the first 50 days of the time node to be predicted, together with the corresponding price information, are used as the inputs of the LSTM model to train the parameters of the LSTM. Finally, the trained LSTM-GARCH-family model is used for the garlic price prediction task at a certain time node.