Applied Mathematics
Vol.09 No.05(2018), Article ID:84790,15 pages

An Artificial Neural Network Model to Analyze Maize Price Behavior in Mexico

Raquel Salazar Moreno, Oscar Zerecero Salazar

Universidad Autónoma Chapingo, Texcoco, Mexico

Copyright © 2018 by authors and Scientific Research Publishing Inc.

This work is licensed under the Creative Commons Attribution International License (CC BY 4.0).

Received: April 8, 2018; Accepted: May 22, 2018; Published: May 25, 2018


Mexican producers were supported by the Government from 1993-2013 through the PROCAMPO (support program, direct subsidy from the federal government), in order to keep the prices stable. The tool used to analyze the basic products price behavior was Artificial Neural Network (ANN) models. Data from the period 1980 to 2014 was available, and two ANN models were implemented, one including only internal prices of related products and the second takes into account also the international maize price. The purpose of this paper was to analyze the impact of internal related products and international maize price on the behavior of internal maize price. Both models demonstrated the powerful of the ANN for prediction of the maize price 3 and 5 years ahead. Also, a sensitivity analysis was performed using Garson’s algorithm, through which was demonstrated that rice, safflower and sorghum are corn’s complementary products. The rice price was the variable with a major positive impact on the national corn price. On the other hand, wheat, soybean and barley behave as corn’s substitute products, with wheat price being the variable with major impact on the corn price. Including the international corn price improves the model performance, besides there was a negative sensitivity between the international and national corn price; this behavior is explained by the fact that during PROCAMPO existence, the national prices were forced to be stable while the international maize price was increasing. Finally, this study showed the application of the ANN models in a particular product price behavior, with the possibility of being used in the decision making process for the application of subsidies to the agricultural producers in public policies.


PROCAMPO, Prediction, Sensitivity Analysis, Policy Impact

1. Introduction

Corn is a staple food in the Mexican diet, currently more than 30% of the sown area in Mexico is occupied by corn. Despite the foregoing, Mexico is not self-sufficient in its production. In the period 1988-2007, Mexico was the fourth largest producer of corn (FAO, 2009); however, the production only covered the demand for white corn, while the consumption of yellow corn was supplied by importations.

After the North American Free Trade Agreement (NAFTA), corn imports increased to more than seven million tons in 2007 [1] , with Mexico being the third largest importer in the world [2] . Moreover, the corn world consumption increased by 3.2 percent to total 1008.7 million tons in 2016-2017, of which 61.9 percent corresponds to fodder consumption and the remaining 38.1 percent to human, industrial and seed.

One of the efforts that were made in the past to encourage corn production in Mexico was the PROCAMPO support program, defined as a direct subsidy that the federal government granted through SAGARPA (Secretary of Agriculture Livestock and Rural Development), began its execution at the end of 1993 until 2013.

PROCAMPO was a subsidy of 1000 pesos per hectare of corn sown, however, 20 percent of producers receive 60 percent of the subsidy and 80 percent of producers receive only 40 percent of the resources [3] . The objectives of PROCAMPO were to provide direct support to more than 3.3 million rural producers, to compensate the subsidies in other countries, especially the developed ones, and at the same time to ensure that national consumers have access to food at lower prices [4] .

The prices movement or production decrease becomes a problem of national interest and it occupies part of the public policy agenda. Corn price plays a fundamental role; it depends to a large extent on many other factors, such as the international corn prices, and the prices of other related products. Therefore, the objectives of this paper are:

1) Analyze the effectiveness of the PROCAMPO program.

2) Build two neural network models in order to simulate the price behavior of corn based on prices of related products and the international price of corn.

3) Perform a sensitivity analysis in the neural network model to determine which price has a greatest effect on the corn price and thus be able to generate a policy of joint support products.

2. Literature Review

Artificial Neural Neworks (ANN) are defined as a computer systems composed of a large number of interconnected elements. It is a new form of computing, inspired by the functioning of the human brain [5] . The ANN models minimize the number of assumptions that are preconceived, and only focus on the data with which the network is fed. Theoretically, a correct ANN design will converge in a number of iterations [6] .

Some authors [7] mention that many methods have been used to attempt share prices predictions like fundamental analysis, technical analysis, and machine learning method, but none of these methods could consistently be applicable as a prediction tool. On the other hand, the authors mention that ANN approach is suitable for chaotic systems such as share prices. Although ANN are not perfect in their predictions, they radically outperform all other existing prediction methods, They appear to be the best modeling method currently available for prediction as they capture nonlinearities in the system without human intervention [8] [9] [10] .

Another result comes from a Ph D thesis [11] in where a comparison between some prediction methods is done and the author conclude that the artificial neural network models were more accurate in predicting the coffee price compared with the integrated autoregressive model of moving average with explanatory variables (ARIMAX).

Also, [12] compared Artificial Neural Networks (ANN) and multivariate statistics in a problem about identification of countries that are likely to seek a rescheduling of their international debt-service obligations, the author conclude that ANN largely outperformed more conventional multivariate statistical procedures usually employed for this problem.

The aspects to be defined in ANN models are the following:

2.1. The Topology or Architecture

The topology or architecture to be use for the analysis in a given problem, it refers to the structure of synaptic connections between neurons, which are grouped into layers: input layer (composed of neurons that receive the information); hidden layer with no connection to the environment and the output layer with a connection to the environment and it is responsible for producing and presenting the final network outputs.

The connections of the neural network can be forward, lateral or backward [13] . In a feedforward multilayer perceptron, information flows in one direction along connecting pathways, from the input layer via the hidden layers to the output layer (Figure 1) [12] .

The neurons in one layer are connected to those in the next layer by connections and weights (synapses), whose values are different for each of the connections [14] .

In Figure 1, x1 … xx represent the inputs, while y1, …, yn are the outputs of the neural network model; 1, …, n1 denotes the number of nodes in the first hidden neural layer; 1, …, n2 is the number of nodes in the second neural layer.

In this sense, the fundamental parameters of the network are: the number of layers, the number of neurons per layer, the degree of connectivity and the type of connections between neurons [13] .

2.2. Transfer or Activation Functions

Each neuron applies a function f known as the activation function or transfer

Figure 1. A feedforward multilayer perceptron architecture [15] .

function, which is a mathematical expression used to approximate the influence of the neurons in the output. The transfer function provides the current activation status of a neuron, based on its weights, inputs and its current postsynaptic potential.

The Activation Functions can be basically divided into 2 types: Linear Activation Functions (Identity and Symmetrical Hard Limit) and Non-linear Activation Functions (log Sigmoid and Hyperbolic Tangent Sigmoid) described in Table 1.

The purpose of an activation or transfer functions is to convert an input signal of a node into an output signal. They introduce non-linear properties in the Artificial Neural Network model. According to [16] the linear transfer function is used between hidden layer and output layer due to the fact that, if sigmoidal neurons are used in the output layer, the output of the network is limited to a very small range; on the contrary, when using a linear neuron, the output can take any value.

Symmetrical Hard Limit function is used mainly for classification problems because it divides the output into two groups. The log Sigmoid function have a range between cero and one and it is especially used for models where we have to predict the probability as an output. Finally the Hyperbolic Tangent Sigmoid is better than logistic sigmoid because its range is from (−1 to 1), so its output is zero centered hence optimization is easier. Both hyperbolic tangent sigmoid and logistic sigmoid activation functions are used in multilayer feed-forward nets [17] .

2.3. Building the Network

The process of building the network consists of three steps: training, testing and validation.

Table 1. Transfer functions.

In the training process the neural network must learn to calculate the correct output for each array or input vector in the set of samples [5] .

The training algorithm may vary depending on the network architecture, but the most common training algorithm used when designing financial neural networks is the backpropagation algorithm, which is the process of backpropagating errors through the system from the output layer towards the input layer, minimizing the sum of the errors on all the examples of the training set. As the errors are backpropagated through the nodes, the connection weights are changed [5] .

The next step is validation to verify if the neural network can solve new problems of the general type, for which it has been trained. Another set of data is presented, called the validation set, using the same weights obtained in the training process, the MSE is calculated between measured and simulated output to check if the network gives good results [13] .

Finally, testing consists of re-training the network with a new data set, but the weights are recalculated. At the end of the process, testing, validation and training must converge to a minimum mean square error [5] .

After building the NN model a sensitivity analysis can be performed to analyze the effect on the output, when a change in the input is observed the Garson algorithm can be applied for this purpose [18] . It consists in distributing the connection weights of the neural network in order to determine the relative importance of each input variable in the network. The Garson Algorithm uses the absolute values of the connection weights when calculating the contribution of each variable and gives us a clear picture of which input variables have a greater effect on the output variable when everything else remains constant [19] .

3. Methodology

The information used in this work was obtained using the Agrifood Information System and Consultation (SIACON) of the SAGARPA and the World Bank Commodity Price Data, for the period of 1980-2014, the prices were deflated using the National Consumer Price Index (INPC) based on the year 2010.

Two ANN models were developed to simulate the domestic price of corn based on the prices of related products such as the real prices of Rice (PRAR), Wheat (PRTR), Safflower (PRCA), Soybeans (PRSY), Sorghum (PRSG), and Barley (PRCE). A second network includes besides the inputs in the first model the Real International Price of Corn (PRIMA).

A Feedforward Multilayer Perceptron architecture was used as shown in Figure 2.

Figure 2. Neural network architecture.

PRAR: Real Rice Price; PRTR: Real Wheat Price; PRCA: Real Safflower Price; PRSY: Real Soybean Price; PRSG: Real Sorghum Price; PRCE: Real Barley Price; PRNMA: Real Maize Price; PRIMA Real Maize International Price; Wnm: Weights from input to hidden layer; Vm: Weights from hidden layer to output layer.

To determine the number of nodes in the hidden layer, 3 criteria were used:

1) h = 2 n + 1 [20] ,

2) h = m n [21] ,

3) h = n (intermediate criteria).

Where h is the maximum number of neurons in the hidden layer; n is the number of input variables and m is the number of outputs. In this work, the three criteria were used, but the first gave the best results.

A hyperbolic tangent function was used between the input layer and the hidden layer, and a linear function between the hidden layer and the output layer because of their advantages mentioned in Section 2.2. In Figure 2 the product prices represents the inputs. A data pattern is presented to the feedforward multilayer perceptron, per example year 1980, this vector of prices goes through the activation function Hyperbolic Tangent Function which maps the inputs to an output between (−1 1) and this output is the input for the next layer. As can be seen in Figure 2 each layer is connected to the next one by weights which are the parameters we want to change with the backpropagation algorithm described before, in such a way that the output in the ANN can be as close as possible to the real data.

A total of 35 data patterns were available, 85% for training, validation and testing. The remaining 15% of the data was used for simulation purposes, data samples are shown in appendix A. To evaluate the model goodness-of fit some statistical measures are suggested by [22] .

The mean squared error (MSE) defined in (1)

M S E = 1 n i = 1 n ( y i y ^ i ) 2 (1)

where y ^ i is the simulated output value, y i is the real output value, n is the number of measurements.

Sometimes is more convenient to work with the Root of the Mean Square Error (RMSE) defined in Equation (2).

R M S E = M S E (2)

When the objective is to examine the overall model error, it is more convenient to calculate the absolute mean error (MAE) displayed in (3).

M A E = 1 n i = 1 N | y i y ^ i | (3)

The last statistical measure used was the Efficiency (EF) defined in (4).

E F = 1 i = 1 n ( y i y ^ i ) 2 i = 1 n ( y i y ¯ ) 2 (4)

where y ^ i is the simulated output value, y i is the real value and y ¯ is the average, if the model is perfect EF = 1, a bad model have a EF = 0 [22] .

4. Results

Figure 3 shows the production and the real prices of corn for the period 1993-2014 within which PROCAMPO program was applied.

During the period in which the PROCAMPO program was carried out, production increased remarkably and real prices remained low. The prices variability during the period of PROCAMPO program was measured through Standart Deviation (S) and Variation Coeficient (CV) defined in Equation (6) and Equation (7).

Results are displayed in Table 2. Soybean prices have the greatest variability in this period, and the lowest variability was for wheat.

s = ( x i x ¯ ) n 1 (6)

V C = s x ¯ 100 (7)

where s is the standard deviation; x i is the real price; x ¯ is the mean of the real price; n is the number of measurements; VC is the variation coefficient.

Figure 3. Production and real price of corn.

Table 2. Basic statistics.

PIM: International corn price.

Using the prices information for the crops from 1980-2014 two NN models were implemented using the Neural Network toobox from Matlab, the first one without taking into account the international maize price, and the second including the international maize price, in both cases the number of nodes were varying according to the three criterion described in methodology, and statistical measurements [22] were obtained, results are shown in Table 3 and Table 4.

For the first model the highest efficiency was obtained with 11 nodes in the hidden layer, while in the second model with 9 nodes in the hidden layer, both models were implemented. After training, validation and testing the results obtained are shown in Figure 4 and Figure 5.

The inclusion of the international corn price increased the efficiency from 0.79 to 0.9, the real and simulated corn price are closer.

Once trained and validated, the ANN model can be used for simulation purposes, using only the inputs without providing the outputs for the years 2010-2014 (Figure 6 and Figure 7).

There is a small difference between real and predicted corn price in both ANN models.

The Garson algorithm was applied to perform the sensitivity analysis for both models; results are presented in Figure 8 and Figure 9.

Table 3. Adjustment measurements without including PRIMA.

Table 4. Adjustment measurements including PRIMA.

Figure 4. Comparison of the real corn price observed and simulated by the ANN model without including the international price of corn.

Figure 5. Comparison of the real price of corn observed and simulated by the network, including the variable of the international price of corn.

Figure 6. Real and predicted corn prices for the ANN model without including the corn international price.

Figure 7. Real and predicted corn prices for the ANN model including the international corn price.

Figure 8. Relative importance of each input variable on the real national price of corn excluding the international price of corn, evaluated with the Garson algorithm.

Figure 9. Effect of the prices of 6 related products and the international price of corn on the real price of corn evaluated with the Garson algorithm.

In Figure 8 predictor contributions ranged from −17% to 31%, with Rice price and Safflower price being the strongest relationships with predicted corn price, and Sorghum price with the weakness relationship with corn price.

If the international price of corn is included (Figure 9) the results only change in the proportion of the effect of each variable, since the price of substitute products such as wheat, soybean and barley maintained a positive effect on the domestic price of corn, while the price of complementary products such as rice, safflower and sorghum continued to have a negative effect on corn price. Again, price of rice have the highest positive sensitivity over the national price of corn. Price of wheat was the variable with the highest negative sensitivity.

The international price of corn (IPM), have a negative effect on the national price of corn, the justification is that the PROCAMPO program was giving to corn producers to prevent the real national price of corn from increasing even though the PRIMA was increasing.

5. Conclusions

The main objective of PROCAMPO program was to increase production while keeping the prices stable, as can be noticed for the period 1993-2013. Two ANN models were implemented for the purpose of simulating the national corn price, one including only the prices of national related products, and the second model including the international price of maize, besides the other prices. Both models have good results, however the inclusion of the international price of maize increased the capability of simulation with an efficiency of 0.9. Years 2010-2014 were used to test the models for prediction purposes, the first model have good results for the 3 years ahead while the second give good results 5 years ahead with very good precision.

The previous result shows that the international price of corn is one of the most relevant variables in explaining the behavior of the national price of corn. The highest positive sensitivity was in the case of the price of rice, which is consistent since rice is another product of the basic basket and is complementary to corn. On the other hand, the price with the highest negative sensitivity was for soybean, barley and wheat, which are complementary products.

This study demonstrates the usefulness of neural network models for simulation purposes, and it can be inferred that incentive programs for agricultural producers should be implemented considering complementary products and substitutes.

Cite this paper

Salazar Moreno, R. and Zerecero Salazar, O. (2018) An Artificial Neural Network Model to Analyze Maize Price Behavior in Mexico. Applied Mathematics, 9, 473-487.


  1. 1. FAO (Food Agriculture Organization) (2009) Statistical Databases.

  2. 2. Chauvet S.M. and González, A.R.L. (2009) Alimentos, biocombustibles y desigualdad social en México.

  3. 3. Schwentesius Rindermann, R., Gómez Cruz, M.á., Trujillo, J.D.D. and Durán Ferman, P. (2007) Metaevaluación de tres evaluaciones oficiales de la SAGARPA del programa de pagos directos (PROCAMPO) a la agricultura mexicana. Estudios sociales (Hermosillo, Son.), 15, 104-134.

  4. 4. SARH, P. (1993) Vamos al grano para progresar. s/f, México.

  5. 5. Matich, D.J. (2001) Redes Neuronales: Conceptos básicos y aplicaciones. Cátedra de Informática Aplicada a la Ingeniería de Procesos-Orientación I.

  6. 6. Gryc, W. (2010) Neural Network Predictions of Stock Price Fluctuations.

  7. 7. Haider, K., Sharmin, A.T. and Hussain, A. (2011) Price Prediction of Share Market using Artificial Neural Network (ANN). International Journal of Computer Applications, 22, 42-47.

  8. 8. Lawrence, R. (1997) Using Neural Networks to Forecast Stock Market Prices. University of Manitoba, Winnipeg.

  9. 9. Benedetti, F., Baigún, A., Yanguas, M., Heymann, D., Perazzo, R. and Zimmermann, M. (2008) Predicciones de Series de Tiempo con Redes Neuronales: Trading usando el índice Merval.

  10. 10. Martínez Lozano, M. (2014) Metodología basada en redes neurales parainterpretación de la resistividad del suelo en zonas urbanas. Ingeniería Energética, 35, 59-69.

  11. 11. Bedoya, C.M. (2016) Estimación de la Producción Mundial del Café y el Precio Diario del Café suave colombiano utilizando Redes Neuronales Artificiales y Modelos Autoregresivos Integrados de Promedios Móviles con Variables Exógenas. Tesis doctoral 2016. Universidad Autónoma Chapingo, Mexico.

  12. 12. Cooper, J.C. (1999) Artificial Neural Networks versus Multivariate Statistics: An application from Economics. Journal of Applied Statistics, 26, 909-921.

  13. 13. Duarte, J.V.C. (2003) Predicción con redes neuronales: comparación con las metodologías de Box y Jenkins. Master Thesis, Universidad de los Andes, Mérida.

  14. 14. Villada, F., Munoz, N. and García-Quintero, E. (2016) Redes Neuronales Artificiales aplicadas a la Predicción del Precio del Oro. Información tecnológica, 27, 143-150.

  15. 15. da Silva, N.I., Hernane, S.D., Andrade, F.R., Bartocci, L. L.H., dos Reis, A.S.F., et al. (2017) Artificial Neural Networks a Practical Course. Springer International Publishing, Switzerland.

  16. 16. Ljung, L. (2008) Perspectives on System Identification. Annual Reviews in Control, 34, 1-12.

  17. 17. Hagan, M.T., Demuth, H.B. and Beale, M.H. (1996) Neural Network Design. Pws Pub., Boston, 19-21.

  18. 18. Garson, G.D. (1991) Interpreting Neural-Network Connection Weights. AI Expert, 6, 46-51.

  19. 19. Olden, J.D. and Jackson, D.A. (2002) Illuminating the “Black Box”: A Randomization Approach for Understanding Variable Contributions in Artificial Neural Networks. Ecological Modelling, 154, 135-150.

  20. 20. Hecht-Nielsen, R. (1987) Nearest Matched Filter Classification of Spatiotemporal Patterns. Applied Optics, 26, 1892-1899.

  21. 21. Masters, T. (1993) Practical Neural Network Recipes in C++. Morgan Kaufmann.

  22. 22. Wilks, D.S. (2011) Statistical Methods in the Atmospheric Sciences. Vol. 100, Academic Press, Cambridge.

Appendix A: Prices of Agricultural Products in Mexican Pesos/Ton