# Forecasting Cost Risks of Corn and Soybean Crops through Monte Carlo Simulation
## 2 Materials and Methods
### Time Series Forecasting Based on Historical Data  
The urea fertilizer (Figure 3A) shows a trend of stability in its price for the next 24 months, while the NPK 05-25-25 fertilizer shows a downward trend (Figure 3B). It is possible to infer that the production cost of soybean planting is likely to decrease for the next two harvests, as the price of the NPK 05-25-25 fertilizer shows a strong correlation with the production cost of this crop. The stability in the price of urea for the next 24 months is due to the significant increase in the exchange rate in recent months, especially for the nitrogen component. It is important to note that the NPK 05-25-25 fertilizer uses 5% of this component in its formulation. Among the models suggested by the software to forecast costs/ha for the next 24 months, DTN-S was able to capture the expected scenario for a near-term trend (730 days) for the cost/ton in Figure 3A, while ARIMA was used for Figure 3B. The blue line represents the price trend (3A) and (3B), and the orange area shows the range where this value can be found in the future trend. The minimum cost/ha/soybean value for Figure 3A (urea fertilizer) was USD 33.90, and, for Figure 3B (NPK 05-25-25 fertilizer), it was USD 139.20. The average values were USD 58.04 and USD 288.02, and the maximum values were USD 120.15 and USD 602.62, with a standard deviation of USD 29.32 and USD 161.58, respectively. The purchasing power of rural producers to acquire one ton of fertilizers was reduced until July 2022, when a recovery trend began, observed in October [35]. As of April 2023, the price of one ton of NPK 05-25-25 fertilizer was USD 696.00, and the price of urea fertilizer was USD 718.00 [29]. These values are considered above the average predicted in this analysis. The difference between the maximum and minimum values presented in this analysis was significant. Using the penalizing criteria of Akaike Information Criterion (AIC) and Bayesian Information Criterion (BIC), the best model for all the simulations performed was found. AIC acknowledges the existence of an unknown \"true\" model that describes the data and aims to select, among a group of evaluated models, the one that minimizes the Kullback-Leibler divergence (KL) and BIC, also known as Schwarz Information Criterion, is a criterion for model selection among a finite set of models. Models with lower BIC values are usually preferred [32]. Figure 3: Price trends for the next 24 months of the variables (green line: historical data, blue line: fitted and forecast; orange area: forecast range with lower and upper bounds of 2.5% and 97.5%, respectively). Knowing that the model that best fits the series is the one with the lowest value, it can be concluded that the most suitable model for Figure 3B is the ARIMA (1, 1, 2) series. The model indicates an order of 1 for the AR component (Auto Regressive), an order of 1 for the 2 component (Integration or differencing), and the last 2 for the MA component (Moving Average). The values for AIC were 5.99 and for BIC were 6.10 * for Figure 3B, based on the lowest mean squared error. For the values presented in Figure 3A, the AIC was 3.32 and the BIC was 3.36 *. The ARIMA model used for Figure 3A showed that the series has an insignificant auto-regressive (AR) component. This is due to the partial autocorrelations of the series, as evidenced by the ARIMA (0, 1, 1) model. However, even so, the autoregressive coefficients and the model coefficient weighted the behavior of the forecast, increasing the accuracy of this variable, thus demonstrating an appropriate model. Additionally, it can be observed that the Durbin-Watson (DW) statistic values, which indicate no first-order correlation, whether positive or negative, are equal to 2.0 for Figure 3A. The TANS model for Figure 3B demonstrated that the series has a non-stationary stochastic process, as the statistical properties of at least one finite sequence of components differ from those of the sequence for at least one integer.