This paper is concerned with time series data for vegetable prices, which have a great impact on human’s life. An accurate forecasting method for prices and an early-warning system in the vegetable market are an urgent need in people’s daily lives. The time series price data contain both linear and nonlinear patterns. Therefore, neither a current linear forecasting nor a neural network can be adequate for modeling and predicting the time series data. The linear forecasting model cannot deal with nonlinear relationships, while the neural network model alone is not able to handle both linear and nonlinear patterns at the same time. The linear Hodrick-Prescott (H-P) filter can extract the trend and cyclical components from time series data. We predict the linear and nonlinear patterns and then combine the two parts linearly to produce a forecast from the original data. This study proposes a structure of a hybrid neural network based on an H-P filter that learns the trend and seasonal patterns separately. The experiment uses vegetable prices data to evaluate the model. Comparisons with the autoregressive integrated moving average method and back propagation artificial neural network methods show that our method has higher accuracy than the others.
Among all the price fluctuations in the market, the prices of agricultural products have the most obvious and basic impact on the cost of living. Many countries have established price early warning systems to monitor and evaluate grain prices so that the price can be timely adjusted and controlled when it is in abnormal state, in order to guarantee that the grain economy develops in a sustainable, healthy, and stable way [
To predict a time series price is a challenging problem according to current studies [
However, time series data forecasting is usually a nonlinear problem, so linear approaches may fail to capture the nonlinear dynamics of the process. There are some nonlinear methods for forecasting future prices using a machine learning model [
In this paper, a hybrid approach, combining H-P filtering [
This paper is organized as follows. Section
The Chinese vegetable market plays an important role in people’s daily life and in the agricultural industry. In 2011, the area planted with vegetables was about 19.7 square kilometers, and vegetable production reached 6.79 million tons. According to a report from the Food and Agriculture Organization (FAO), China has 43 percent of the planted area of the world and 50 percent of the production of the world, and so it is ranked as the first in the world vegetable production.
However, vegetable prices have been volatile in recent years. There are many factors that have an influence on vegetable prices, such as population, national policies, area of arable land, international financial markets, price of alternatives, economic growth, and international trade. Here, we study the hidden patterns behind the history of vegetable prices to see if we can build a more accurate model for price forecasting.
There are several methods for extracting the trend and cyclical components from an original single set of data. As the prediction results from the two components need to be merged together, we have to find a linear filter to separate the original single set of data. Here, we choose the linear Hodrick-Prescott filter to get the trend and cyclical components [
The H-P filter [
The parameter
Artificial neural networks (ANN) are popular models for studying nonlinear relationship functions. One of the most significant advantages of an ANN model is that it can approximate a large class of functions with a high degree of accuracy [
A single hidden layer feed-forward network is the most widely used model form for time series modeling and forecasting [
Structure of the three layers of a neural network.
Hence, the neural network model of (
The function learning process uses a back propagation training algorithm [
Finally, the estimated model is evaluated using a separate hold-out sample that has not been exposed to the training process.
In this section, we will introduce the proposed forecasting model. The whole system framework will be presented first. Then, the model formulation will be given. Finally, we will discuss the workflow of our forecasting scheme.
The module description of our proposed time series data forecast framework is presented in Figure
Framework of the proposed forecasting approach.
In the first stage, the time series price data are passed through the H-P filter. Trend and cyclical components are generated. This decomposition allows us to model the trend and the cyclical fluctuations of the time series separately and more accurately. As the H-P filter is a linear filter, we can merge these two components after forecasting. It must be noted that the trend and the cyclical components are separately learned by ANNT and ANNC. Then, in the next stage, we select suitable features to be applied to the ANN models and forecast each component individually. In the third stage, we use a linear function to merge the two components together as the original data series forecasting result.
The behavior of vegetable prices may not easily be captured by stand-alone models because the price time series data could include a variety of characteristics such as seasonality, heteroskedasticity, or a non-Gaussian error. Our hybrid model aims to reduce the dimension of the raw data. As the raw data contains multidimensional variables, we need to find a more complex function to fit the data. The artificial neural network needs to have more nodes and more layers to learn the complex function. This also requires more time to train the ANN, which will increase the risk of failure and make the results less accurate. After we have reduced the dimension of the raw data, the artificial neural networks are easier to train and the predictive performance will be improved in the combined models.
Based on Box’s [
As we can see from (
The overall flowchart of the proposed H-P filter based neural network forecasting is shown in Figure
The overall flowchart of the proposed forecasting approach.
Prepare the raw data of the vegetable price time series
Preprocess the raw price data using the H-P filter and generate two series of data:
According to the time series data cycle
Use the heuristic algorithm to select the optimal number of neurons in the hidden layers of ANNT and ANNC and initialize the parameters of each neural network.
Use the back propagation algorithm to train the neural network.
Repeat Steps
The proposed forecasting scheme is briefly described in the following steps.
Select the latest data within a cycle as the input data.
Preprocess these data using the H-P filter.
Use the trained ANNT and ANNC to forecast the price at the next date.
Combine the results of the two networks as the final forecast price value.
In this section, we will use two popular forecasting models to compare with our proposed method. These time series come from the monthly price data for five types of vegetable from 2012 to 2013. We randomly choose the price data for one cycle as the testing dataset and the remaining data as the training dataset. All the experiments are done using Matlab R2013b in the Windows 7 platform. We choose the neural network function in the Matlab toolbox [
We choose the prices of five types of vegetable: cabbages, peppers, cucumbers, green beans, and tomatoes. The price trends of the five types of vegetable are shown in Figure
Price trends of the five types of vegetable from 2012/01/01 to 2013/03/01.
In Table
The price characteristics of the five types of vegetable.
Price type | Cycle (month) | Variance |
---|---|---|
Cabbages | 11.24 | 0.2916 |
Peppers | 11.25 | 2.8361 |
Cucumbers | 11.25 | 1.8933 |
Green beans | 11.25 | 3.9992 |
Tomatoes | 11.25 | 1.5610 |
We implement two traditional forecasting models ARIMA and ANN to compare with the proposed model.
In the present study, several trials were carried out to choose the optimal ARIMA model parameters. The model parameters that satisfy the statistical residual diagnostic checking were chosen for the ARIMA forecasting model. In an ARIMA
The Box [
From Tables
Cabbage ARIMA (2, 1, 5)(1, 1, 1)12 model predictions contrast (unit: RMB/kg).
Date | Observation | Forecast | Date | Observation | Forecast |
---|---|---|---|---|---|
2012-01 | 1.52 | 1.44 | 2012-07 | 2.18 | 2.48 |
2012-02 | 1.65 | 1.5 | 2012-08 | 2.40 | 3.05 |
2012-03 | 1.85 | 2 | 2012-09 | 2.41 | 2.57 |
2012-04 | 2.31 | 2.61 | 2012-10 | 2.08 | 1.81 |
2012-05 | 2.25 | 2.82 | 2012-11 | 1.84 | 1.61 |
2012-06 | 2.06 | 2.52 | 2012-12 | 1.85 | 1.85 |
Pepper ARIMA (2, 1, 2)(1, 1, 1)12 model predictions contrast (unit: RMB/kg).
Date | Observation | Forecast | Date | Observation | Forecast |
---|---|---|---|---|---|
2012-01 | 9.84 | 7.10 | 2012-07 | 4.25 | 4.02 |
2012-02 | 7.95 | 7.57 | 2012-08 | 4.16 | 4.09 |
2012-03 | 9.57 | 7.78 | 2012-09 | 4.26 | 4.40 |
2012-04 | 7.96 | 7.20 | 2012-10 | 4.13 | 4.84 |
2012-05 | 6.56 | 5.74 | 2012-11 | 4.39 | 5.32 |
2012-06 | 4.75 | 4.43 | 2012-12 | 5.67 | 6.12 |
Cucumber ARIMA (1, 1, 1)(1, 1, 1)12 model predictions contrast (unit: RMB/kg).
Date | Observation | Forecast | Date | Observation | Forecast |
---|---|---|---|---|---|
2012-01 | 8.17 | 6.08 | 2012-07 | 3.11 | 2.89 |
2012-02 | 6.35 | 6.32 | 2012-08 | 3.8 | 3.39 |
2012-03 | 6.21 | 5.74 | 2012-09 | 3.43 | 3.62 |
2012-04 | 5.04 | 4.71 | 2012-10 | 3.44 | 3.96 |
2012-05 | 3.56 | 3.68 | 2012-11 | 4.38 | 4.67 |
2012-06 | 2.71 | 2.84 | 2012-12 | 5.69 | 5.56 |
Green bean ARIMA (2, 1, 1)(1, 1, 1)12 model predictions contrast (unit: RMB/kg).
Date | Observation | Forecast | Date | Observation | Forecast |
---|---|---|---|---|---|
2012-01 | 9.95 | 8.65 | 2012-07 | 4.78 | 5.10 |
2012-02 | 9.3 | 9.18 | 2012-08 | 5.6 | 5.63 |
2012-03 | 10.12 | 9.64 | 2012-09 | 5.58 | 6.06 |
2012-04 | 9.2 | 8.56 | 2012-10 | 5.19 | 6.26 |
2012-05 | 6.29 | 7.12 | 2012-11 | 6.96 | 7.06 |
2012-06 | 4.64 | 5.097 | 2012-12 | 8.13 | 8.05 |
Tomato ARIMA (1, 1, 1)(1, 1, 1)12 model predictions contrast (unit: RMB/kg).
Date | Observation | Forecast | Date | Observation | Forecast |
---|---|---|---|---|---|
2012-01 | 5.82 | 5.26 | 2012-07 | 3.75 | 3.36 |
2012-02 | 5.92 | 5.48 | 2012-08 | 4.61 | 3.65 |
2012-03 | 6.42 | 5.28 | 2012-09 | 5 | 3.95 |
2012-04 | 6.69 | 5.15 | 2012-10 | 4.41 | 4.31 |
2012-05 | 5.17 | 4.42 | 2012-11 | 4.75 | 4.58 |
2012-06 | 3.78 | 3.49 | 2012-12 | 5.46 | 4.90 |
A three-layer feed-forward neural network model was developed for the prediction of the price series data using an optimized back propagation training algorithm. In the present study, the scaled conjugated gradient algorithm was selected as the optimized training method. The network structure is shown in Figure
Regression of the predictive data using ANN.
Cabbage price prediction using ANN
Pepper price prediction using ANN
Cucumber price prediction using ANN
Green bean price prediction using ANN
Tomato price prediction using ANN
From Figure
Our proposed model uses the same data from the previous 12 months as the testing dataset. First, we need to extract the trend and cyclical components. Figure
Example of H-P filter results.
Regression of the proposed predictive data and real data.
Cabbage price prediction using the proposed model
Pepper price prediction using the proposed model
Cucumber price prediction using the proposed model
Green bean price prediction using the proposed model
Tomato price prediction using the proposed model
The neural network uses the same structure as we used in Section
Figure
To illustrate the accuracy of the method, two different forecast consistency measures are used for the different types of vegetables. The root mean squared error (RMSE, (
Table
A comparison of the accuracy of the three methods in forecasting the prices of the five vegetables.
Model | Cabbages | Peppers | Cucumbers | Green beans | Tomatoes | |||||
---|---|---|---|---|---|---|---|---|---|---|
RMSE | MAE | RMSE | MAE | RMSE | MAE | RMSE | MAE | RMSE | MAE | |
Autoregressive integrated moving average (ARIMA) | 0.33 | 0.11 | 1.07 | 1.15 | 0.66 | 0.44 | 0.62 | 0.39 | 0.77 | 0.6 |
Artificial neural networks (ANN) | 0.24 | 0.21 | 0.88 | 0.67 | 1.12 | 0.90 | 0.73 | 0.55 | 0.89 | 0.79 |
Proposed model | 0.19 | 0.15 | 0.79 | 0.37 | 0.51 | 0.34 | 0.46 | 0.38 | 0.42 | 0.37 |
Time series forecasting is one of the most important quantitative models and has received a considerable amount of attention in the literature. This study presents a novel adaptive approach to extending the artificial neural network model; adaptive metrics of the inputs and a new mechanism for mixing the outputs are proposed for time series prediction. Due to the individual modeling of the trend and cyclical components, the forecasting accuracy is improved. The experimental results generated by a set of consistent performance measures with different metrics (RMSE, MAE) show that this new method can improve the accuracy of time series prediction. The performance of the proposed method is validated by time series data for five sets of vegetables.
The authors declare that there is no conflict of interests regarding the publication of this paper.
This work was supported in part by the Major Program of National Social Science Foundation of China (Project no. 12&ZD048) and by the National Social Science Foundation of China (Project no. 13CJY104).