Notoriously, Brazil's agribusiness sector is one of the most significant for the balance of the Brazilian trade balance, boosting the country as one of the largest exporters of agricultural commodities in the world. This position of the country was highlighted in the world media when last year the agronomist Alysson Paolinelli, current president of Abramilho (Brazilian Association of Corn Producers), was nominated to compete for the Nobel Peace Prize, arousing the curiosity of the population: why an agronomist for a peace prize? Simple: he was one of the responsible for the agricultural revolution of the Brazilian cerrado in the 1970s, transforming the region into one of the most productive and competitive areas in the world, leveraging its productivity and reaching 40% of the world's food production, enabling global food security by 2050 and, consequently, reducing the possibility of wars between countries by food (EMBRAPA, 2021).
However, in the winter of 2021 the country was beset by daily news of "burning" crops in various parts of the country in the face of strong waves of frost snares not seen for long times, consequently causing one of the largest releases of rural insurance resources ever accounted for by banks. More severe waves of cold air masses in winter or hot air masses in summer, as well as previously rare weather events such as tornadoes, dust waves (such as the current ones seen in Ribeirão Preto and Franca in the interior of São Paulo due to the region's long drought period) have been attributed to climate change in the world, generating increasing apprehension on the part of producers - since some varieties of hardwood, grains or fruits are more susceptible to loss of quality or even total loss of production in the face of small variations in temperature, pressure, wind, radiation, rainfall, among other factors, deserving greater attention to climatic variations in relation to others. However, whether it is the loss of quality or the total burning of the crop, it will generate fluctuations in its price in the face of the restriction of supply, raising prices, or reduction of the price for lower quality of the agricultural product.
Among the numerous varieties of crops affected in the recently ending winter with frosts, the coffee planted in the south and southwest of Minas Gerais was one of the most impacted, leveraging its price in the national and international market. Thus, this scientific report aimed to research what are the variables arranged by inmet (National Institute of Meteorology) collected for the cities of Varginha, Passos, São Sebastião do Paraíso, Caldas, Machado and Passa Quatro, which contribute the most to fluctuations in the percentage variation of the price of Arabica coffee. The variables arranged by the INMET collected are those that can cause the various types of frost - advection, radiation, mixed, black or white or arising from climate change:
- Precipitation in mm,
- Pressure in hPa,
- Radiation in KJ/m²,
- Temperature in the bulb in ºC ,
- Dew temperature in ºC,
- Humidity in %
- Wind in m/s.
Data were collected for all hours of the day between January 1, 2015 and August 30, 2021 for each city. Only these cities were arranged by INMET for the southern and southwestern mesoregion of Minas Gerais. In sequence, the data went through cleaning processes, organization in months and finally grouped into monthly averages, except for rainfall in which the monthly sum was made. Due to the volume of variables under analysis, we chose to use only 1 lag lag, since the Decision Tree and Random Forest tooling do not lag time series, requiring the configuration directly in the supply worksheet of the lag of each variable. The use of more than one lag would make the trees very complex and would end up not being useful - a matter of statistical parsimony.
Coffee prices were collected at CEPEA/ESALQ/USP, with selection only of the Arabica variety, since it is the modality most affected by frosts and widely exported worldwide. The data were daily, then also passed for the monthly period. Finally, the time series was calculated in its return, in order to evaluate the high or low in the percentage variations of its price and make it closer to parking and avoid some possible overfting process. The methodology of natural logarithms was not used to facilitate the analysis of the percentages of price fluctuation, although it left the series less stationary. However, machine learning algorithm models do not require time series adjustments as in traditional econometric models.
After the relevance of the use of variables, cleaning and organization of data (the most laborious part in this study), the applications of machine learning were started with separation of data in training and testing using the software R. We opted for the approach of 70% of the data as Training and 30% as Test. The first analysis then was the Decision Tree, generating the following tree:
Figure 1: Decision Tree for Arabica Coffee Price Change
To test the accuracy of the tree, the RMSE, MAE and MAPE tests were rotated in order to compare the predicted errors of the variation in the price of coffee with the price collected. It can be observed in the table that the errors were relatively low, offering credibility to the results:Table 1: Decision Tree Accuracy Tests
RMSE | MAE | MAPE |
0.0641999 | 0.04811713 | 1.263708 |
It can be noted that radiation make up the first two nodes, with the radiation of the current month being the first node and the radiation of the month preceding the next branch of nodes. The largest variation in the price of coffee was a high of 13% configured by an average radiation between 1208 and 1284 KJ/m² in the month, configuring 7% of the cases - seen in the branches to the extreme direct of the tree. Radiation was still responsible for a high of 11% in 4% of cases in the face of radiation lower than 1208 KJ/m² in the month and greater than 1367 KJ/m² in the previous month (lag 1).
The largest drop variation in the price of Arabica coffee, coincidentally, was the branching to the extreme left side, with a drop of 10% when the average radiation of the month is less than 1208 KJ/m², the average radiation of the previous month is less than 1367 KJ/m², as well as the pressure of the previous and current month are respectively lower than 914 hPa and 908 hPa. However, with a one-fifth node branch in which the dew temperature in the previous month is less than 11ºC, there is a 9.2% drop in price. If this dew temperature is greater than 11ºC, with humidity, radiation and precipitation from the previous month greater than or equal to 73%, 811 KJ/m², 163 mm, the price change will return to 7.7%. Other smaller variations for more or less can be analyzed on the chart according to other generated branches.
Because the branches can change in the face of the choice of the first or second nodes change, the appropriate thing is to sequentially do a Random Forest analysis. In this machine learning proposal, the programming for the generation of 30 decision trees was configured and a second prediction model was looked at. The results of accuracy of the latter were:Table 2: Random Forest model accuracy tests
RMSE | MAE | MAPE |
0.06205481 | 0.04832602 | 1.139206 |
In the results, it was notethat two tests, RMSE and MAPE, indicated improvement of the Random Forest model compared to the first Decision Tree model, slightly reducing its error, confirming the maintenance of the analyses. The MAE test maintained a very equivalent result in both. Changing the number of trees between 15 and 40, the results were maintained.
Once the suitability of the second Random Forest model was completed, the same was applied in a series of climate change simulations, mainly for frost formation, but not only. Possible changes in these variables from climate change were also considered. We tried to reduce average percentages equivalent to those that may occur in winter periods, with a reduction of approximately 50% in temperature for both the contemporary month and the month before it, considering the only lag under analysis. The other variables were tested with increase and decreases that may occur for each type of frost, for the contemporary month and the lag.
The greatest impacts observed were in the alterations of the radiation and pressure variables, responsible for the configuration of radiation frost. This is characterized by high pressure systems together radiation loss, leading to energy loss and cooling (AGROSMART, 2021). Next tables are arranged with the variations applied to each variable independent of INMET and its result in the variable dependent on variations in the price of Arabica coffee:Table 3: fluctuations in the component variables of radiation frost and mixed frost
Variable | Variation % | |||
RADIATION | -50% | -50% | -50% | 100% |
PRECIPITATION | 0% | 0% | 0% | 0% |
PRESSURE | 100% | 50% | 100% | 0% |
BULB TEMPERATURE | 0% | 0% | -50% | 0% |
DEW TEMPERATURE | 0% | 0% | -50% | 0% |
MOISTURE | 0% | 0% | 0% | 0% |
WIND | 0% | 0% | 300% | 0% |
Changes in the monthly percentage change in the price of Arabica Coffee | 1,62% | 1,62% | 2,01% | 4,85% |
It can be noted that, regardless of the increase or decrease in pressure, which together with the increase in radiation generates radiation frost, the average increase in price variation is equivalent to 1.62% monthly. When the entry of cold air with a drop in temperature in both the bulb and the dew temperature (simulated with a 50% reduction in temperature) was added together to triple the average wind speed of the southern and southwestern mesoregion of Minas Gerais, the price variation rises slightly more, reaching 2.01% per month. This sum of impacting variables constitutes a possible mixed frost (AGROSMART, 2021). However, the simple increase in 100% of the average radiation of the mesoregion in isolation increases the variation in the price of Arabica coffee to a strong level of up to 4.85% per month.
With the increase in greenhouse gas emissions, radiation retention is increasing and increasingly. Part of the radiation that reaches Earth is reflected back into space, and the rest is retained by the oceans and continents. The problem is that greenhouse gases have accentuated this retention, increasing the heat on earth (WWF, 2021), which can be harmful to plantations, causing losses and rising prices, as can be seen in the results.
In analysis only the variables that could cause a white frost, formatted when intense cooling occurs with ice deposition in plants and high humidity, the following results were achieved with simulation of an average drop of 50% of temperature and 200% increase in humidity: Table 4: fluctuation of the component variables of white frost and advection
Variable | Change % | |
RADIATION | 0% | 0% |
PRECIPITATION | 0% | 0% |
PRESSURE | 0% | 0% |
BULB TEMPERATURE | -50% | -50% |
DEW TEMPERATURE | -50% | -50% |
MOISTURE | 200% | 0% |
WIND | 0% | 200% |
Changes in the monthly percentage change in the price of Arabica Coffee | -1,43% | 0,956% |
It is observed that this simulation generated an average monthly fall in the variation of the coffee price by 1.43%, thus not increasing its price. It can be understood that with these percentages of reduction can cause damage in the plantations, but not burning them, reducing their price in the market in the face of the lower quality offered. For the situation of burning higher average percentages would need to be allocated.
Under attention is a possible frost of advection with simulation of temperature drop by 50% and increase of the average wind speed by 200%, maintaining without variation the humidity, there is an average increase in the variation of the price of Arabica coffee by 0.956% per month.
Finally, in the context of lack of rainfall that has been sow this month in some regions of the country, causing restrictions on water use, reductions and increases in rainfall were simulated, ranging between 50 and 100% on average:
Table 5: precipitation fluctuations
Variable | Change % | ||||
RADIATION | 0% | 0% | 0% | 0% | 0% |
PRECIPITATION | 50% | 100% | 200% | -50% | -100% |
PRESSURE | 0% | 0% | 0% | 0% | 0% |
BULB TEMPERATURE | 0% | 0% | 0% | 0% | 0% |
DEW TEMPERATURE | 0% | 0% | 0% | 0% | 0% |
MOISTURE | 0% | 0% | 0% | 0% | 0% |
WIND | 0% | 0% | 0% | 0% | 0% |
Changes in the monthly percentage change in the price of Arabica Coffee | 0,08% | 0,186% | 0,314% | 0,114% | 0,79% |
It can be seen that a fall in rainfall in the southern and southwestern mesoregion of Minas Gerais of 50% interferes little in the price variation, but a 100% drop in rainfall, simulating a dry period, increases the price of average monthly coffee by 0.79%. On the other hand, an increase in rainfall will result in a progressive increase in the average variation of Arabica coffee, starting at an almost zero value of variation with 50% more rainfall, but reaching 0.314% monthly with an average 200% higher.
References
AGROSMART. Geada: entenda sua formação e como minimizar os efeitos na lavoura. Disponível em https://agrosmart.com.br/blog/geada-formacao-minimizar-efeitos-lavoura/. Acesso em: 27 jul. 2021.
CEPEA/ESALQ. Disponível em: https://www.cepea.esalq.usp.br/br. Acesso em 20 mai. 2021.EMBRAPA. Notícias. Disponível em: https://www.embrapa.br/busca-de-noticias/-/noticia/61176196/indicado-ao-nobel-da-paz-alysson-paolinelli-destaca-o-a-historia-e-os-desafios-da-pesquisa-agropecuaria-brasileira-em-palestra-on-line. Acesso em 29 set. 2021.
INMET. Dados históricos anuais. Disponível em: https://portal.inmet.gov.br/dadoshistoricos. Acesso em 15 abr. 2021.
WWF. As mudanças climáticas. Disponível em: https://www.wwf.org.br/natureza_brasileira/reducao_de_impactos2/clima/mudancas_climaticas2/. Acesso em 30 set. 2021.