Next Article in Journal
Willingness to Participate in Vehicle-to-Everything (V2X) in Sweden, 2022—Using an Electric Vehicle’s Battery for More Than Transport
Previous Article in Journal
Fuzzy Logic Method for Measuring Sustainable Decent Work Levels as a Corporate Social Responsibility Approach
Previous Article in Special Issue
A Comparison of Deep Transfer Learning Methods for Land Use and Land Cover Classification
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Using Probabilistic Machine Learning Methods to Improve Beef Cattle Price Modeling and Promote Beef Production Efficiency and Sustainability in Canada

1
Agriculture and Agri-Food Canada, Lethbridge Research and Development Centre, Lethbridge, AB T1J 4B1, Canada
2
B-IT and Department of Computer Science, University of Bonn, 53115 Bonn, Germany
*
Authors to whom correspondence should be addressed.
Sustainability 2024, 16(5), 1789; https://0-doi-org.brum.beds.ac.uk/10.3390/su16051789
Submission received: 13 December 2023 / Revised: 20 January 2024 / Accepted: 23 January 2024 / Published: 22 February 2024
(This article belongs to the Special Issue Artificial Intelligence and Sustainability)

Abstract

:
Accurate agricultural commodity price models enable efficient allocation of limited natural resources, leading to improved sustainability in agriculture. Because of climate change, price volatility and uncertainty in the sector are expected to increase in the future, increasing the need for improved price modeling. With the emergence of machine learning (ML) algorithms, novel tools are now available to enhance the modeling of agricultural commodity prices. This research explores both univariate and multivariate ML techniques to perform probabilistic price prediction modeling for the Canadian beef industry, taking into account beef production, commodity markets, and international trade features to enhance accuracy. We model Alberta fed steer prices using three multivariate ML algorithms (support vector regression (SVR), random forest (RF), and Adaboost (AB)) and three univariate ML algorithms (autoregressive integrated moving average (ARIMA), seasonal ARIMA (SARIMA), and the seasonal autoregressive integrated moving average with exogenous factors (SARIMAX)). We apply these models to monthly fed steer price data between January 2005 and September 2023 and compare predicted prices with observed prices using several validation metrics. The outcomes indicate that both random forest (RF) and Adaboost (AB) show superior overall performance in accurately predicting Alberta fed steer prices in comparison to other algorithms. To better account for the variance of the best model performance, we subsequently adopted a probabilistic approach by considering uncertainty in our best-selected ML model. The beef industry can use these improved price models to minimize resource waste and inefficiency in the sector and improve the long-term sustainability prospects for beef producers in Canada.

1. Introduction

Agricultural commodity markets are often uncertain and unpredictable and can be affected by a wide variety of factors, including but not limited to the following: agricultural input prices and production conditions; fuel and other commodity price swings; agriculture industry financial factors; weather, natural disasters, and climate change; the global economy; and political shocks. Consequently, reliable and timely agricultural commodity price modeling is critical to ensuring the sustainability and economic viability of the agricultural sector by providing better information on commodity price behavior. The increasing availability of ever larger and more comprehensive sets of agricultural data, as well as the consistent need for accurate commodity price models, necessitates the development of robust and efficient analysis techniques that can be used to improve our understanding of commodity prices from current observations.
Agricultural commodity price modeling has a long history in agricultural economics, and many different methods have been applied. These have included using time series econometric models, tracking futures prices, expert opinions, and qualitative assessments. The advent of machine learning offers new techniques to analyze and use for commodity price modeling. Identifying the appropriate machine learning methods for agriculture price analysis has gotten less attention than the application of ML to other non-agricultural sectors [1,2], and thus, more research on machine learning strategies appropriate for agricultural price analysis is required [3].
To contribute to this research, we make use of the long-term historical cattle price data available from the CanFax research service. CanFax is an established market research firm that specializes in the analysis of the Canadian beef sector “www.canfax.ca/Research.aspx (accessed on 6 October 2023)”. We structure fed cattle price prediction as a machine learning problem using key price and production data for the Canadian beef sector from CanFax and several other sources, and we assess the ability of widely used machine learning algorithms to predict observed fed cattle prices using information from important correlated data. We also generate price predictions with realistic variance by modeling the probability distribution of the residual and considering it as an error term. We assume that the actual prices and residuals are realizations of a normally distributed random variable characterized by an average of zero and a variance derived from the differences between the actual and predicted data. This allows us to consider uncertainty in our ML modeling [4].
Machine learning methods are well suited to discovering complex relationships and hidden patterns across multivariate datasets. This flexibility and pattern recognition capacity minimize the errors that can arise from the incorrect application of structural models of agricultural commodity price processes. The following is a summary of our main contributions to this study:
  • With the long-term historical data available on cattle prices, agricultural commodity markets, economic indices, and international trade features, we structure price prediction as a machine learning problem that can be more accurate, consistent, and efficient than traditional time series statistical methods.
  • Three multivariate machine learning algorithms—support vector regression, random forest regression, and Adaboost regressor models—and three univariate time series algorithms—autoregressive integrated moving average (ARIMA), seasonal ARIMA (SARIMA), and the seasonal autoregressive integrated moving average with exogenous factors (SARIMAX)—were applied to long-term historical fed cattle price datasets (2005 to 2023) in Alberta. We assess the performance of these algorithms against observed fed cattle prices and identify the best machine learning algorithm for fed cattle price prediction.
  • The multivariate machine learning approach offers a feasible alternative to structural multivariate autoregressive modeling and can efficiently combine fed beef price data and related beef market factors, minimizing modeling errors and data requirements.
The rest of the paper is organized as follows: Section 2 reviews existing research on agricultural commodity price analysis, machine learning applications in the agricultural sector, and research on commodity price analysis and sustainability outcomes. Section 3 discusses the materials and methods used in this study, including the study domain and data descriptions, variables used, data preprocessing and partitioning, an introduction to each of the algorithms, as well as model validation and the chosen technical approach. Section 4 discusses the findings of both multivariate and univariate models, as well as feature engineering, hyperparameter optimization, hyperparameter tuning, and the robustness of the models. In this section, we apply a probabilistic modeling approach to the best-selected ML model. Section 5 presents some discussion of the findings, and Section 6 concludes.

2. Background Literature

Agricultural commodity price modeling has been performed for many decades, employing a wide variety of methods, from expert opinion outlooks and time series analysis [5,6,7] to more recent forays into machine learning approaches [2,8].
Livestock price modeling has been an important segment of agricultural price analysis work, particularly in North America, and prior research has demonstrated that useful models depend on assessing a complex set of factors, including animal health and production dynamics, seasonal, cyclical, and spatial patterns [9], feed grain production conditions [7,10] and even finance and macroeconomic conditions for regions where livestock exports and imports are important [6].
A variety of methods have been employed, from univariate time series models to multivariate time series and structured multiple equation models of both livestock prices as well as the prices of important related inputs, like feeds. An early example of univariate modeling by Oliveira et al. [11] uses the ARIMA Box-Jenkins approach to produce short-run forecasts of live cattle prices, compares these to futures prices, and finds that ARIMA models do well at short horizons. Zapata and Garcia [12] compare multivariate vector auto-regression and error correction (VAR, VEC) approaches to predict cattle slaughter prices in the United States based on monthly data from lagged prices as well as feeder prices and per capita consumer incomes. Several other statistical approaches are outlined in detail in Linnell [13].
Beyond statistical approaches, another analysis is produced for livestock markets worldwide based on expert opinions from knowledgeable stakeholders and either public or private advisers in the livestock sector. Farm Credit Canada provides outlook reports, and the CanFax Research Service produces a weekly expert report for subscribers, combining quantitative and qualitative assessments of the livestock markets in Canada and the U.S. (canfax.ca). The United States Department of Agriculture, as well as several individual U.S. state agricultural departments, produce a wide variety of publicly available reports on livestock market conditions, which is important for Canadian producers given the high level of integration between Canadian and U.S. livestock markets. Many researchers also argue that ensemble analyses that combine and average the results from several different methodologies are better for assessing livestock market performance [5,7,13].
Evidence in the literature of prior use of machine learning to analyze cattle prices is limited. Kohzadi et al. [14] employed a walk-forward or sliding window technique on commodity price data from 1970 through 1990 to compare artificial neural networks to time series models for modeling commodity prices of cattle and wheat. They found that the ARIMA model did not perform as well as the neural network models. The ARIMA model was most comparable for wheat, but the neural network models were able to catch a substantial number of turning points for both wheat and cattle. Beyond these references, there appears to be minimal exploration in the academic literature of machine learning for livestock price analysis, particularly in Canada. However, there appears to be an increasing uptake of machine learning models in the private sector to provide commodity price modeling services more broadly, but within this, agricultural commodity prices again do not appear to be a major focus. More literature review on the various research and applications of these techniques for the agricultural sector is summarized in Table 1. Thus, our paper can fill this literature gap by analyzing Canadian fed steer prices with machine learning techniques, adding both a methodological and subject-matter contribution to our understanding of beef price data.

Agricultural Commodity Price Information and Sustainability

Statistics Canada and organizations such as Canfax routinely provide livestock market data to producers and agricultural stakeholders to help guide decision making about beef production, marketing, and trade. The availability of accurate agricultural price data has long been regarded as a key factor in promoting a successful and productive agricultural sector [30]. Accurate agricultural price information monitoring has been associated with securing global objectives on food security and environmental sustainability [31]. Thus, using new methodological tools such as ML to analyze agricultural commodity prices can supplement these broader objectives to increase global access to accurate agricultural commodity market information and improve both production efficiency and sustainability.

3. Materials and Methods

3.1. Study Domain

The study domain of this research is Alberta, a province in the west of the Canadian Prairies. Since the late 1950s, the cattle industry has gained prominence in the province and is a key component of the province’s agricultural sector. Canada contributes significantly to the trade and consumption of beef around the world, and approximately 11.5 million cattle exist in Canada, including 9.5 million beef and 2.0 million dairy cattle. Canada is the world’s 12th largest beef producer, with 1.50 million tons (2% of world totals) of beef produced in 2020 [32]. Canada exports 47.4% of its beef, accounting for 4.8% of worldwide exports in 2020, and ranks seventh among beef exporters. Western Canada has 3.2 million beef cows, and 79% of Canada’s fed cattle are finished for slaughter [32]. Alberta has the largest average herd size (255 head) with 1.5 million (41%) beef cows in total, followed by Saskatchewan (1.1 million beef cows, 191 head/producer) (31%), and Manitoba (412 thousand beef cows, 167 head/producer) (11%) [32]. Figure 1 shows some statistics about Canada’s beef cows in Canada’s provinces.

3.2. Data Acquisition, Description, and Exploration

This study uses historical cattle price data gathered from CanFax [33], a market research firm that is a much-relied-upon source of cattle market information in Canada. CanFax Research Services (CRS) delivers comprehensive statistical and market information on domestic and worldwide beef trends in the Canadian beef sector. The dataset includes regularly updated monthly cattle prices (CAD/cwt) starting in January 2005 to September 2023 for fed steer cattle in Alberta, along with several other cattle classes. In order to perform a multivariate machine learning analysis for predicting cattle prices, we constructed a variable matrix comprising several key data series known to be related to cattle prices. For our analysis, we include the consumer price index, which is a measure of overall price inflation, for all items in Canada [34], the monthly average Alberta natural gas price [35] (CAD/gigajoule (GJ)), which is strongly related to agricultural production costs, the Canadian–US dollar exchange rate [36], and Alberta barely prices [37] (CAD/tonne), as barley is the main feed grain used in Alberta beef production. Table 2 summarizes the annual average values for these variables. Figure 2 and Figure 3 also visualize the time series trends of fed steer prices and these related variables that we used for predicting cattle prices from January 2005 to September 2023. The natural gas price and exchange rate display the highest volatility over time. Meanwhile, the fed steer price, barley price, and Canadian consumer price index show a noticeable steep increase in trend starting in 2020, coinciding with the onset of the COVID-19 pandemic outbreak.
We used Pearson correlation analysis to investigate the correlations between the predictors and fed steer prices. The correlation values are statistically significant (p-value < 0.01) between fed steer and predictor variables and are displayed in Figure 4.
It shows that there is a high positive relationship between the price of fed steer cattle and the Canadian consumer price index (0.86), Alberta barley prices (0.73), and the exchange rate (0.66). Cattle prices, on the other hand, are negatively correlated with the natural gas price (−0.52).

3.3. Data Preprocessing, Partitioning (Train-Test), and Tuning

First, the quality of the data is visually checked by searching for obvious errors, outliers, and missing data. For testing the stationary assumption of the data, we utilized Augmented Dickey–Fuller (ADF) tests and determined that first-order differencing was sufficient to transform all variables, with the exception of the consumer price index. The consumer price index required second-order differencing to achieve stationarity. Consequently, for the multivariate dataset, the application of second-order differencing resulted in the entire dataset becoming stationary.
Then, we estimate the multivariate models using the training dataset on the scaled trained data (min-max scaler). Preprocessing the data with the min-max scaler constrains the range of our dataset, and scaling the data enhances model stability and facilitates machine learning analysis. Subsequently, we utilized these models to make predictions and assessed their performance on the scaled test dataset. We used 80% of the data for training and 20% for testing. The next step is to ‘tune’ the machine learning model, which is a way of prioritizing different features in terms of their importance in the overall prediction performance. We used the ‘hyper-parameter module technique’ to tune our training datasets. This technique discovers the ideal hyperparameter for each specific machine learning algorithm individually by comparing several model settings and comparing the metric to get the best combination of settings. The tuned model hyperparameter approach is used to improve the performance of the model [38].

3.4. An Introduction to Machine Learning Algorithms and Description

Despite the limited applications in agricultural commodity price analysis, machine learning is widely used in a variety of other fields to address complex problems that are difficult to solve with traditional analytical methods [39]. ML is an artificial intelligence branch that uses algorithms rather than model-based analysis [40] to systematically synthesize the core connections between data and information with the purpose of predicting future scenarios. The main strength of machine learning is identifying underlying relationships within datasets via pattern detection and prediction. ML systems can also detect disruptions to existing models and redesign and retrain themselves to adapt to and coevolve with new information. By relying on historical experience, the machine learning process plays a critical role in generalizing prediction problems to allow for maximum extraction of useful information from prior observed behaviors and patterns. Thus, historical observed data become ‘training’ datasets for the machine learning algorithms and better allow the ML model to generate largely accurate predictions even in novel situations. Many big data applications use ML to run at optimal efficiency. Here, we applied our ML techniques to analyze fed steer prices using two different approaches: multivariate and univariate modeling.

3.4.1. Multivariate Analysis

After preparing the data matrix, we applied multivariate and univariate algorithms to predict Alberta fed steer prices. For multivariate machine learning regression modeling, we applied three robust and widely used algorithms: random forest, Adaboost, and support vector machines.
Support Vector Machines (SVM) are a commonly used classification technique that properly categorizes data. Theoretically, it only takes a short training sample and is unaffected by the number of dimensions, but it can be computationally intensive. Furthermore, effective approaches for training SVM are being developed at a swift pace, and they can also be used for regression purposes by making minor changes [41,42,43].
Random forests (RF), which were introduced by Breiman [44], are a set of tree predictors in which each tree is determined by the values of a random vector selected separately with an identical distribution of the trees in the forest. As a widely used classification and regression approach, the random forest has proven to be quite an effective method, which aggregates numerous randomized decision trees and averages their predictions. It has proven to be able to perform well in situations where the number of variables exceeds the number of observations. Furthermore, it is adaptable to a variety of unstructured learning tasks and provides measures of variable significance, making it suitable for large-scale problems [45]. The RF algorithm assesses the significance of every feature in the prediction process and displays lower sensitivity to feature scaling and normalization. This characteristic makes it simpler for training and tuning.
The Adaboost algorithm, or adaptive boosting, is another multivariate method that we applied in this study. Adaboost, among the initial practical boosting techniques, was pioneered by Freund and Schapire [46]. Its primary concept is based on merging multiple classifiers, termed weak learners, into a singular classifier called a strong classifier by optimizing it through a weighted linear combination and integrating one weak classifier at each step.
Boosting is an ensemble method and employs multiple predictors to enhance accuracy in regression and classification tasks. To amplify and diversify the training dataset, boosting involves sequential sampling, repeatedly drawing samples with replacements from the original data. These methods are learned in a series, primarily benefiting unstable learners like neural networks or decision trees. There’s some indication that boosting leads to heightened accuracy levels [47,48].
Each machine learning algorithm has its own set of strengths and weaknesses. For example, Random Forest and Adaboost might be susceptible to overfitting, especially when confronted with noisy datasets. It is important to highlight that Adaboost, despite being designed for improved generalization, can still be vulnerable to overfitting. To mitigate the impact of noisy data and outliers in the original dataset, particularly for Adaboost, we implemented specific data preprocessing strategies as detailed in the paper (in Section 3.3).
Moreover, these models may demand significant computational resources, particularly when handling complex datasets. In situations involving imbalanced datasets, they may show a bias toward the dominant or majority class. Another weakness of RF is its sensitivity to hyperparameters, necessitating meticulous tuning to achieve optimal performance. Additionally, RF models typically operate on fixed datasets, presenting obstacles to the seamless integration of continuous updates with new data. The SVR algorithm shares similar weaknesses, with its main challenge lying in its sensitivity to hyperparameters. The efficacy of SVR is greatly contingent on the precise tuning of kernel parameters and the identification of their optimal values. Furthermore, interpreting SVR can be challenging due to its black-box nature, impeding a clear understanding of the relationships between features and the output. Therefore, proper parameter tuning and feature scaling are imperative for ensuring the effective application of SVR.
Despite these weaknesses, these ML algorithms remain widely used and effective in various applications. Addressing these limitations often involves precise hyperparameter tuning, feature engineering, and considering alternative models based on the dataset’s specific characteristics. Also, careful consideration of these limitations and appropriate preprocessing strategies can help mitigate some of these challenges.

3.4.2. Univariate Analysis

For the univariate approach, we used the autoregressive integrated moving average (ARIMA) model, seasonal ARIMA (SARIMA), and the seasonal autoregressive integrated moving average with exogenous factors (SARIMAX). Here, to predict fed steer prices, we only used its previous or historical time series data. Univariate time-series analysis is a method for explaining sequential problems over regular time intervals. When a continuous variable is time-dependent, it is advantageous to apply this method, especially when finding consistent patterns in market data.
ARIMA is a class of models that explains a time series based on its own past values. ARIMA models can be used to model any non-seasonal time series that has patterns and is not random white noise. Making the time series stationary is the first step in creating an ARIMA model, which is achieved through differencing. Depending on the complexity of the series, multiple levels of differencing may be required. Linear regression machine learning models work best when the predictors are not correlated and are independent of one another.
The problem with the basic ARIMA model is that it does not account for seasonality. Considering the seasonality effect, seasonal terms should be added to the ARIMA model to create the Seasonal ARIMA model (SARIMA). Seasonal differencing is used by SARIMA, which is similar to regular differencing, except that instead of subtracting consecutive terms, the value from the previous season is subtracted.
The SARIMAX model is able to deal with external factors. We can include an external predictor, also known as an ‘exogenous variable’, in the model with the seasonal index. The seasonal index repeats every frequency cycle.
In univariate time series modeling, ARIMA, SARIMA, and SARIMAX are very popular time series prediction models, but like every other model, they also have some weaknesses. ARIMA models assume that the underlying relationships in the time series are linear. They may not capture non-linear relationships effectively, which limits their flexibility. They are also sensitive to order selection, and determining the optimal orders is the main challenge for these models. In the SARIMA model, despite accounting for seasonality, it may not capture complex seasonal patterns. Additionally, these models assume that the variance of the residuals is constant over time. Table 3 presents a summary of the multivariate and univariate machine learning algorithms that were assessed in this study.

3.5. Validation Methods

A comparison between the multivariate and univariate algorithms is done to evaluate the best models’ performance on cattle price prediction. To minimize errors in prediction models, predicted prices are assessed using mean absolute error (MAE), root mean square error (RMSE), mean square error (MSE), mean absolute percentage error (MAPE), mean percentage error (MPE), and root mean square percentage error (RMSPE) [53,54,55,56].
The mean absolute error (MAE) is an extensively used metric for verifying a deterministic prediction and shows the magnitude of the error regardless of the prediction value [57,58]. The average distance between a data point and the fitted line, measured along a vertical line, is known as the root mean squared error (RMSE). RMSE is sensitive to outliers and exhibits both under- and over-estimation in the same pattern. The mean squared error (MSE) measures the average squared gap between observed and predicted values. By utilizing squared units rather than the original data units, it magnifies the influence of larger errors, causing them to be penalized more heavily than smaller errors. This attribute is crucial when identifying a model with smaller errors. MAPE represents the average absolute error in percentages by calculating the average of the absolute percentage errors. This method provides a straightforward interpretation of errors in percentage terms [57]. MPE is similar to MAPE, but it does not involve taking the absolute value of the errors. This can be valuable when you want to understand whether the model tends to under-forecast or over-forecast. The primary advantage of MPE is comparing variances between data sets with different scales. RMSPE is the square root of the mean of the squared percentage errors. It penalizes larger errors more than MAPE. This metric gauges the distance between predicted values and the actual values in the dataset, referred to as the “residual” or prediction error. It indicates how closely the actual data aligns with the line of best fit. A lower score reflects the better predictive performance of the model [59]. The formulas for each metric are listed below.
M A E = 1 n i = 1 n O i P i
R M S E = 1 n i = 1 n O i P i 2
M S E = 1 n i = 1 n O i P i 2
M A P E = 100 n i = 1 n O i P i O i
M P E = 100 n i = 1 n O i P i O i
R M S P E = 100 × 1 n   i = 1 n O i P i O i 2
where O i is observed data, P i is a deterministic prediction, and n is the number of observations. Models with the lowest metric values were assumed to be the best models, as these metrices are negatively oriented.

3.6. Technical Approach at a Glance

In this research, we utilized Python, a powerful and versatile programming language, as the foundation for our entire data processing pipeline. Python’s extensive libraries and tools have enabled us to seamlessly integrate various stages of our workflow, including data exploration, feature engineering, data analytics, and visualization. This approach ensures consistency and efficiency throughout our research process.
We employed Scikit-learn in ML modeling, which is a widely used Python library, for implementing various tasks in our machine learning pipeline. This choice was driven by Scikit-learn’s comprehensive suite of tools for data preprocessing, cross-validation, hyperparameter tuning, and model training, specifically for algorithms like SVM, RF, and Adaboost. Scikit-learn is particularly favored in data analytics research due to its ease of use, robustness, and comprehensive nature of its algorithms, which are well-suited for a wide range of data types and machine learning tasks.
Our regression pipeline for the multivariate models entailed the following steps: (1) in data preprocessing, we considered relevant samples and features, ensuring the data were appropriate for the models considering stationary assumption and scaling; (2) in data splitting, the dataset was split into training and testing subsets, a standard practice in machine learning to evaluate model performance; (3) in data normalization, we applied MinMaxScaler to the data to bring all variables to a similar scale, which is crucial for algorithms like SVM that are sensitive to the scale of input features; (4) in hyperparameter tuning, each algorithm underwent separate hyperparameter tuning to identify the optimal parameters. This process is critical to enhance model performance and prevent issues like overfitting; and (5) in model evaluation, after choosing the best parameters, the models were trained on the training sample and subsequently evaluated on the testing sample to assess their predictive accuracy and generalizability.
Statistical analysis was done with the Statsmodels library for our univariate analyses of the ARIMA, SARIMA, and SARIMAX models. Statsmodels is an essential tool in our research due to its extensive capabilities in statistical modeling, hypothesis testing, and data exploration, making it ideal for detailed statistical analysis. The use of Statsmodels in our research is justified by its strong statistical foundation, offering precise and reliable tools for time series analysis, which are vital for making informed predictions and understanding temporal dynamics in our data.
The pipeline for the univariate models involves the following: (1) model identification, which determines the order of the ARIMA/SARIMA model by examining autocorrelation and partial autocorrelation functions of the time series data; (2) in parameter estimation of the model, we used techniques like maximum likelihood estimation; (3) in model diagnostics, we assessed the model’s performance by checking for autocorrelation in the residuals and ensuring the residuals are normally distributed; and (4) in forecasting, we use the model to make forecasts and evaluate the accuracy of these forecasts against real data. Through the combined use of Scikit-learn and Statsmodels, our research leverages the strengths of both machine learning and statistical modeling, ensuring a robust and comprehensive analysis of the data. This integration allows us to capitalize on the predictive power of machine learning while also benefiting from the inferential capabilities of statistical models, thereby enriching our research findings.

4. Results

4.1. Hyperparameter Optimization

Hyperparameter optimization (HPO) is a crucial step in the development of machine learning models, essential for refining models, improving generalization, and ensuring optimal performance on new, unseen data. In machine learning algorithms, hyperparameters are configuration settings that must be specified before the training process, as they are not learned from the data. These hyperparameters significantly influence the performance of a machine learning model.
In hyperparameter optimization, we aim to discover the optimal set of hyperparameters for effective generalization of unseen data, enhancing the model’s performance. Within various existing HPO techniques, we utilized the existing HPO frameworks in SKlearn, which are implemented to select optimal hyperparameters through grid search and random search algorithms. The performance of each configuration is evaluated using cross-validation [60]. For each algorithm, we considered a range of hyperparameter values. To exhaustively evaluating the model’s performance for each combination, we utilized cross-validation (CV = 10) to ensure robust generalization capabilities. Table 4 outlines the selected parameters and their respective ranges.
The optimization process typically involves dividing the dataset into training and test or validation sets, training the model with different hyperparameter values on the training set, and evaluating the model’s performance on the test set. This iterative process continues until the best set of hyperparameters is identified.

4.2. Feature Selection and Hyperparameter Tuning

Fine-tuning hyperparameters is crucial for algorithms and enhancing the machine learning model’s overall performance. This process is established before the learning phase and is conducted externally to the model. Without adequate hyperparameter tuning, the model cannot deliver accurate results since the minimization of the loss function does not take place and will be prone to making errors. Hyperparameter tuning aims to identify the optimal values that maximize the model’s performance, minimize loss, and generate improved modeling results. Table 5 summarizes the most important parameters in multivariate ML models, with the best-selected hyperparameters for our data shown. Table 6 and Table 7 also show the best-selected hyperparameters of univariate models and the best-selected time-series model residuals using the results.
In the univariate time series models, we applied a stepwise approach to find the best model with the lowest Akaike information criterion (AIC) among multiple combinations of model parameters for the ARIMA, SARIMA, and SARIMAX models. Table 7 describes some additional summary statistics of time series model residuals using the results. Prob (Q) is the p-value for the null hypothesis that the residuals have no correlation structure. Prob (JB) is the p-value associated with the null hypothesis that the residuals are Gaussian normally distributed. If either of the p-values is less than 0.05, the hypothesis is rejected. When the values of prob (Q) and prob (JB) are near 0.00, we can reject the null hypothesis that the residuals are not Gaussian normally distributed and have some correlation structure. The Akaike information criterion (AIC) and Bayesian information criterion (BIC) were used to estimate the parameters of the best-fit ARIMA model in time series modeling [61]. Using the stepwise approach, a seasonal interval of 12 months or one year is chosen for the SARIMA-based machine learning problem, which implies that price patterns repeat in a similar way every year rather than at a higher frequency pattern every quarter or season. Within SARIMAX, the consumer price index is chosen as an exogenous term due to its independence but high correlation with agricultural commodity prices.

4.3. Validation of Multivariate and Univariate Machine Learning Models

Upon running the ML models on the training data, we computed the various validation metrics to assess the model’s performance using the remaining 20% of the test dataset. Smaller values of MAE, RMSE, MSE, MAPE, MPE, and RMSPE indicate better performance since they are negatively oriented metrics. As a result, we can be confident in the model’s ability to accurately model cattle price values. The accuracy of our models is summarized in Table 8.
Comparing the performance of all models, the random forest and Adaboost models were selected as outstanding multivariate models according to the validation metrices on the test data for predicting monthly Alberta fed steer cattle prices.

4.4. Robustness of the Models

To secure the robustness of the models, we took additional steps. As a preliminary step, we segregated the dataset into training and test sets, in which modeling analyses were initially conducted on the training subset, and subsequently, the performance was assessed on the test subset. In addition to the test evaluation, the training accuracy is also detailed in Table 9. Examining the validation metrics on the training data also shows a high level of modeling accuracy, increasing confidence in the robustness of our approaches.
Moving forward, we applied cross-validation to identify optimal hyperparameters for each specific machine learning algorithm. Applying cross-validation is essential in identifying optimal hyperparameters in machine learning for various reasons, such as optimizing hyperparameters, preventing overfitting, reducing variability, and ensuring a more realistic evaluation. Cross-validation contributes to a reliable and unbiased estimation of a model’s performance. Simulating how the model generalizes to different subsets of the data facilitates the identification of optimal hyperparameters, resulting in a robust and well-generalized assessment.

4.5. Applying Probabilistic Modeling Approach to the Selected Machine Learning Model

Since both RF and AB demonstrated comparable high performance, we opted to present the remaining validation visualizations solely using the RF model. The RF model’s primary outcome estimates the anticipated cattle price but lacks variance, leading to a decrease in variance for the RF deterministic forecasts. The most statistically valid method to produce predictions with realistic variance is modeling the probability density of the residual and taking it into account. The premise is that the scaled actual price and residuals are realizations of a univariate Gaussian random variable, with an average of zero and a variance based on the disparities between the actual and RF-predicted values. A Gaussian distribution was assumed for the residuals for simplicity in modeling the conditional distribution. This approach yields realizations of the conditional distribution of the actual price values using a probabilistic approach. Figure 5 shows the visualization of the scaled actual and probabilistic RF predicted for the test data set from January 2005 to September 2023. Also, the boxplots illustrate 500 realizations of the probabilistic, generated prices, indicating the inner quartile range within these forecasts. The whiskers represent the 0.025 and 0.975 quantiles. The graph demonstrates that the outcomes of our probabilistic RF prediction model fall within the 95% confidence interval. The zoomed visualization of the test data verification (the right side of Figure 5 is represented in Figure 6).

5. Discussion

The results of the Random Forest and Adaboost modeling of fed steer prices provide confidence in our approach. Even taking errors in the predicted prices into account, the actual fed steer price test data falls within the 95% confidence interval for most of the test data period. The multivariate approach also provides some approximation of the variability of fed steer prices. Univariate models are unable to reflect this more detailed agricultural commodity price behavior over such a long time horizon and are typically only used to develop in-sample forecasts for two or three time periods. So, the potential of being able to more fully and feasibly incorporate multiple important data features into the fed steer price model is a useful addition to existing agricultural commodity price modeling methods.
There seems to be an exception in our model estimates occurring around test point 34 in Figure 6, which corresponds approximately to the winter of 2022. This was a period of very high inflationary pressures in North America, and fed steer prices also showed a steep increase during this time period. So, our ML approach was not able to fully capture this shift in the time trends for beef prices. However, the predictions returned to the 95% confidence interval shortly after this, so this discrepancy appears to have been temporary. This suggests that there is more work to be done to build a multivariate model that can more closely keep up with more infrequent agricultural commodity price swings, but our initial modeling efforts have nonetheless performed very well.
With the increasing availability of machine learning analysis tools, it should be possible for other analysts to similarly construct reasonable multivariate machine learning models of fed steer prices and other agricultural commodity price data. These machine learning models can then be added to the portfolio of more traditional commodity price modeling techniques and help build a more robust ensemble picture of agricultural commodity price behavior and trends.

6. Conclusions

Alberta’s cattle industry is important to the province’s economy. The province is a key producer of beef in Canada, boasting the largest distribution of feeder beef cattle and calves. Cattle prices in Alberta have experienced considerable fluctuations from 2005 until the present due to multiple influencing factors. We believe that modeling these prices holds significance for farmers, policymakers, insurance companies, and traders, enabling informed marketing decisions and risk management. This study highlights the successful predictive ability of machine learning algorithms in anticipating cattle prices and their associated uncertainties in Alberta. Factors like data quality, variable selection, and model optimization are pivotal aspects that can be well ensured with machine learning approaches without compromising performance. Greater use of standard machine learning methods in commodity price modeling has the potential to improve our ability to analyze agricultural commodity prices. In this paper, we have conducted a side-by-side comparison of univariate and multivariate machine learning modeling methods on monthly fed steer prices in Alberta between January 2005 and September 2023. We can summarize this study’s outcomes with three main points:
  • Multivariate modeling, incorporating additional key variables as predictors, demonstrated an advantage over univariate approaches in our investigation.
  • Probabilistic modeling has an advantage compared to deterministic modeling. By employing probabilistic modeling, we consider uncertainties and incorporate them into deterministic RF predictions, providing a more realistic context for the predicted values with the selected RF model. This process should be more routinely applied to other machine learning modeling studies.
  • Lastly, in the comparison of multivariate machine learning algorithms, the Adaboost and Random Forest models exhibited almost similar and robust validation performance with respect to our variables. When comparing univariate models, SARIMAX demonstrated the best univariate time series model, considering the seasonal effect and incorporating the Canadian consumer price index as an exogenous term. However, multivariate models performed better overall.
Machine learning methods with additional probabilistic modeling can thus improve our analytical capacity by enabling more accurate model selection by ‘letting the data speak’ as well as better incorporating new information and complex time series data structure elements. Future steps involve investigating whether a multivariate approach could further enhance the prediction of fed steer prices in a year characterized by significant shocks and dynamic influences such as inflation, more variation in grain prices, and exchange rates.
Possible future work derived from this study could include the following:
  • Further refining and enhancing the existing ML models by exploring additional algorithms, fine-tuning hyperparameters, or considering ensemble machine learning methods for improved predictive performance for agricultural commodity prices.
  • Exploring advanced ML techniques such as deep learning or reinforcement learning to evaluate their relevance and potential advantages in cattle price prediction.
  • Investigating the impact of some additional external factors or variables on the cattle price prediction models, such as environmental factors and climate variabilities and resource availability, geopolitical shocks, economic indicators, or other relevant factors that could contribute to a more comprehensive understanding of price dynamics.
The methods used in this manuscript are becoming more accessible to livestock sector researchers and analysts, and our work should help support additional explorations of the value of machine learning in understanding commodity price dynamics. Our contribution can also help minimize the impact of commodity price shocks on production and sustainability through better modeling.

Author Contributions

E.R. and E.S. contributed equally to the writing of the original draft of this manuscript. Conceptualization, E.R., M.K. and E.S.; methodology, E.R., M.K. and E.S.; software, E.R. and M.K.; validation, E.R., M.K. and E.S.; formal analysis, E.R. and E.S.; writing—original draft preparation, E.R. and E.S.; writing—review and editing, E.R., M.K. and E.S.; visualization, E.R.; supervision, E.S. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Data Availability Statement

The monthly Alberta fed steer prices used in this research are proprietary data for CanFax Research Service subscribers but may be available on request. The monthly average Alberta fed steer prices are freely available via Statistics Canada (Table 32-10-0077-01 Farm product prices, crops and livestock, https://0-doi-org.brum.beds.ac.uk/10.25318/3210007701-eng).

Acknowledgments

Special thanks go to Brenna Grant, executive director of CanFax and CanFax Research Services in Calgary, Alberta, Canada, for making the long-term Alberta fed steer weekly price data available for research.

Conflicts of Interest

The authors declare no conflicts of interest, and CanFax had no role in the design of the study; in the analyses or interpretation of data; or in the writing of the manuscript. Permission was requested and received from CanFax to publish our research findings.

References

  1. Liakos, K.G.; Busato, P.; Moshou, D.; Pearson, S.; Bochtis, D.J.S. Machine learning in agriculture: A review. Sensors 2018, 18, 2674. [Google Scholar] [CrossRef] [PubMed]
  2. Ouyang, H.; Wei, X.; Wu, Q. Agricultural commodity futures prices prediction via long-and short-term time series network. J. Appl. Econ. 2019, 22, 468–483. [Google Scholar] [CrossRef]
  3. Chen, Z.; Li, C.; Sun, W. Bitcoin price prediction using machine learning: An approach to sample dimension engineering. J. Comput. Appl. Math. 2020, 365, 112395. [Google Scholar] [CrossRef]
  4. Rahmani, E.; Friederichs, P.; Keller, J.; Hense, A. Development of an effective and potentially scalable weather generator for temperature and growing degree days. Theor. Appl. Climatol. 2016, 124, 1167–1186. [Google Scholar] [CrossRef]
  5. Colino, E.V.; Irwin, S.H. Outlook vs. futures: Three decades of evidence in hog and cattle markets. Am. J. Agric. Econ. 2010, 92, 1–15. [Google Scholar] [CrossRef]
  6. Marsh, J.M. US feeder cattle prices: Effects of finance and risk, cow-calf and feedlot technologies, and Mexican feeder imports. J. Agric. Resour. Econ. 2001, 26, 463–477. [Google Scholar]
  7. Tomek, W.G. Commodity prices revisited. Agric. Resour. Econ. Rev. 2000, 29, 125–137. [Google Scholar] [CrossRef]
  8. Zhao, H. Futures price prediction of agricultural products based on machine learning. Neural Comput. Appl. 2021, 33, 837–850. [Google Scholar] [CrossRef]
  9. Blank, S.C.; Saitone, T.L.; Sexton, R.J. Calf and yearling prices in the western United States: Spatial, quality, and temporal factors in satellite video auctions. J. Agric. Resour. Econ. 2016, 41, 458–480. [Google Scholar]
  10. Sanders, D.R.; Manfredo, M.R. USDA livestock price forecasts: A comprehensive evaluation. J. Agric. Resour. Econ. 2003, 28, 316–334. [Google Scholar]
  11. Oliveira, R.A.; O’connor, C.W.; Smith, G.W. Short-run forecasting models of beef prices. West. J. Agric. Econ. 1979, 4, 45–55. [Google Scholar]
  12. Zapata, H.O.; Garcia, P. Price forecasting with time-series methods and nonstationary data: An application to monthly US cattle prices. West. J. Agric. Econ. 1990, 15, 123–132. [Google Scholar]
  13. Linnell, P.B. Forecasting Fed Cattle Prices: Errors and Performance During Periods of High Volatility. Master’s Thesis, Colorado State University, Fort Collins, CO, USA, 2017. [Google Scholar]
  14. Kohzadi, N.; Boyd, M.S.; Kermanshahi, B.; Kaastra, I.J.N. A comparison of artificial neural network and time series models for forecasting commodity prices. Neurocomputing 1996, 10, 169–181. [Google Scholar] [CrossRef]
  15. Jeong, S.; Ko, J.; Yeom, J.M. Predicting rice yield at pixel scale through synthetic use of crop and deep learning models with satellite data in South and North Korea. Sci. Total Environ. 2022, 802, 149726. [Google Scholar] [CrossRef] [PubMed]
  16. Sharma, A.; Jain, A.; Gupta, P.; Chowdary, V. Machine Learning Applications for Precision Agriculture: A Comprehensive Review. IEEE Access 2021, 9, 4843–4873. [Google Scholar] [CrossRef]
  17. Liu, W.; Shao, X.-F.; Wu, C.-H.; Qiao, P. A systematic literature review on applications of information and communication technologies and blockchain technologies for precision agriculture development. J. Clean. Prod. 2021, 298, 126763. [Google Scholar] [CrossRef]
  18. Maroli, A.; Narwane, V.S.; Gardas, B.B. Applications of IoT for achieving sustainability in agricultural sector: A comprehensive review. J. Environ. Manag. 2021, 298, 113488. [Google Scholar] [CrossRef] [PubMed]
  19. Meshram, V.; Patil, K.; Meshram, V.; Hanchate, D.; Ramkteke, S.D. Machine learning in agriculture domain: A state-of-art survey. Artif. Intell. Life Sci. 2021, 1, 100010. [Google Scholar] [CrossRef]
  20. Tian, H.; Wang, P.; Tansey, K.; Zhang, J.; Zhang, S.; Li, H. An LSTM neural network for improving wheat yield estimates by integrating remote sensing data and meteorological data in the Guanzhong Plain, PR China. Agric. For. Meteorol. 2021, 310, 108629. [Google Scholar] [CrossRef]
  21. Divisekara, R.W.; Jayasinghe, G.; Kumari, K.J.S.B. Economics. Forecasting the red lentils commodity market price using SARIMA models. SN Bus. Econ. 2021, 1, 20. [Google Scholar] [CrossRef]
  22. Sharma, R.; Kamble, S.S.; Gunasekaran, A.; Kumar, V.; Kumar, A.J.C.; Research, O. A systematic literature review on machine learning applications for sustainable agriculture supply chain performance. Comput. Oper. Res. 2020, 119, 104926. [Google Scholar] [CrossRef]
  23. Kamir, E.; Waldner, F.; Hochman, Z. Estimating wheat yields in Australia using climate records, satellite image time series and machine learning methods. ISPRS J. Photogramm. Remote Sens. 2020, 160, 124–135. [Google Scholar] [CrossRef]
  24. Yamaç, S.S.; Todorovic, M. Estimation of daily potato crop evapotranspiration using three different machine learning algorithms and four scenarios of available meteorological data. Agric. Water Manag. 2020, 228, 105875. [Google Scholar] [CrossRef]
  25. Van Klompenburg, T.; Kassahun, A.; Catal, C. Crop yield prediction using machine learning: A systematic literature review. Comput. Electron. Agric. 2020, 177, 105709. [Google Scholar] [CrossRef]
  26. Vidyarthi, S.K.; Tiwari, R.; Singh, S.K.; Xiao, H.W. Prediction of size and mass of pistachio kernels using random Forest machine learning. J. Food Process Eng. 2020, 43, e13473. [Google Scholar] [CrossRef]
  27. Cai, Y.; Guan, K.; Lobell, D.; Potgieter, A.B.; Wang, S.; Peng, J.; Xu, T.; Asseng, S.; Zhang, Y.; You, L.; et al. Integrating satellite and climate data to predict wheat yield in Australia using machine learning approaches. Agric. For. Meteorol. 2019, 274, 144–159. [Google Scholar] [CrossRef]
  28. Kouadio, L.; Deo, R.C.; Byrareddy, V.; Adamowski, J.F.; Mushtaq, S.; Phuong Nguyen, V. Artificial intelligence approach for the prediction of Robusta coffee yield using soil fertility properties. Comput. Electron. Agric. 2018, 155, 324–338. [Google Scholar] [CrossRef]
  29. Prajapati, B.P.; Kathiriya, D.R. Towards the new Similarity Measures in Application of Machine Learning Techniques on Agriculture Dataset. Int. J. Comput. Appl. 2016, 6, 38. [Google Scholar] [CrossRef]
  30. Shepherd, A. Market Information Services: Theory and Practice; FAO: Rome, Italy, 1997. [Google Scholar]
  31. Dorward, A. Agricultural labour productivity, food prices and sustainable development impacts and indicators. Food Policy 2013, 39, 40–50. [Google Scholar] [CrossRef]
  32. CanadaBeef. Canada’s Beef Industry FAST FACTS. Available online: https://canadabeef.ca/wp-content/uploads/2021/09/Canada-Beef-Fast-Fact-Sheet-2021.pdf (accessed on 16 December 2023).
  33. CanFax. CanFax Data. Available online: https://www.canfax.ca/Research.aspx (accessed on 5 December 2023).
  34. FRED. Economic Data-Consumer Price Index. Available online: https://fred.stlouisfed.org/series/CPALCY01CAM661N (accessed on 19 November 2023).
  35. AlbertaGov. Natural Gas Price. Available online: https://economicdashboard.alberta.ca/dashboard/natural-gas-price# (accessed on 5 December 2023).
  36. FRED. Economic Data-Exchange Rate. Available online: https://fred.stlouisfed.org/series/EXCAUS (accessed on 20 November 2023).
  37. AlbertaGov. Wheat-Barley Price. Available online: https://economicdashboard.alberta.ca/dashboard/wheat-price#Product:Barley (accessed on 19 November 2023).
  38. Jumin, E.; Basaruddin, F.B.; Yusoff, Y.B.M.; Latif, S.D.; Ahmed, A.N. Solar radiation prediction using boosted decision tree regression model: A case study in Malaysia. Environ. Sci. Pollut. Res. Int. 2021, 28, 26571–26583. [Google Scholar] [CrossRef]
  39. Maulud, D.; Abdulazeez, A.M. A Review on Linear Regression Comprehensive in Machine Learning. J. Appl. Sci. Technol. Trends 2020, 1, 140–147. [Google Scholar] [CrossRef]
  40. Athey, S.; Imbens, G.W. Machine learning methods that economists should know about. Annu. Rev. Econ. 2019, 11, 685–725. [Google Scholar] [CrossRef]
  41. Cortes, C.; Vapnik, V. Support-vector networks. Mach. Learn. 1995, 20, 273–297. [Google Scholar] [CrossRef]
  42. Sharifzadeh, M.; Sikinioti-Lock, A.; Shah, N. Machine-learning methods for integrated renewable power generation: A comparative study of artificial neural networks, support vector regression, and Gaussian Process Regression. Renew. Sustain. Energy Rev. 2019, 108, 513–538. [Google Scholar] [CrossRef]
  43. Wu, X.; Kumar, V.; Ross Quinlan, J.; Ghosh, J.; Yang, Q.; Motoda, H.; McLachlan, G.J.; Ng, A.; Liu, B.; Yu, P.S.; et al. Top 10 algorithms in data mining. Knowl. Inf. Syst. 2007, 14, 1–37. [Google Scholar] [CrossRef]
  44. Breiman, L. Random forests. Mach. Learn. 2001, 45, 5–32. [Google Scholar] [CrossRef]
  45. Biau, G.; Scornet, E. A random forest guided tour. Test 2016, 25, 197–227. [Google Scholar] [CrossRef]
  46. Freund, Y.; Schapire, R.; Abe, N. A short introduction to boosting. J. Jpn. Soc. Artif. Intell. 1999, 14, 1612. [Google Scholar]
  47. Drucker, H. Improving regressors using boosting techniques. ICML 1997, 97, e115. [Google Scholar]
  48. Kummer, N.; Najjaran, H. Adaboost. MRT: Boosting regression for multivariate estimation. Artif. Intell. Res. 2014, 3, 64–76. [Google Scholar]
  49. Lu, J.; Hu, H.; Bai, Y. Generalized radial basis function neural network based on an improved dynamic particle swarm optimization and AdaBoost algorithm. Neurocomputing 2015, 152, 305–315. [Google Scholar] [CrossRef]
  50. Sevinç, E. An empowered AdaBoost algorithm implementation: A COVID-19 dataset study. Comput. Ind. Eng. 2022, 165, 107912. [Google Scholar] [CrossRef] [PubMed]
  51. Awad, M.; Khanna, R. Efficient Learning Machines: Theories, Concepts, and Applications for Engineers and System Designers; Springer Science+Business Media: New York, NY, USA, 2015. [Google Scholar]
  52. Greener, J.G.; Kandathil, S.M.; Moffat, L.; Jones, D.T. A guide to machine learning for biologists. Nat. Rev. Mol. Cell Biol. 2022, 23, 40–55. [Google Scholar] [CrossRef] [PubMed]
  53. Kumari, S.N.; Tan, A. Modeling and forecasting volatility series: With reference to gold price. Thail. Stat. 2018, 16, 63–77. [Google Scholar]
  54. Mahmoudzadeh, H.; Matinfar, H.R.; Taghizadeh-Mehrjardi, R.; Kerry, R. Spatial prediction of soil organic carbon using machine learning techniques in western Iran. Geoderma Reg. 2020, 21, e00260. [Google Scholar] [CrossRef]
  55. Rahmani, E. The Effect of Climate Variability on Wheat in Iran. Ph.D. Thesis, Rheinische Friedrich-Wilhelms-Universität Bonn, Bonn, Germany, 2015. [Google Scholar]
  56. Vijh, M.; Chandola, D.; Tikkiwal, V.A.; Kumar, A. stock closing price prediction using machine learning techniques. Procedia Comput. Sci. 2020, 167, 599–606. [Google Scholar] [CrossRef]
  57. Dubey, A.K.; Kumar, A.; García-Díaz, V.; Sharma, A.K.; Kanhaiya, K. Assessments. Study and analysis of SARIMA and LSTM in forecasting time series data. Sustain. Energy Technol. Assess. 2021, 47, 101474. [Google Scholar] [CrossRef]
  58. Gneiting, T.; Raftery, A.E.; Westveld, A.H., III; Goldman, T. Calibrated probabilistic forecasting using ensemble model output statistics and minimum CRPS estimation. Mon. Weather. Rev. 2005, 133, 1098–1118. [Google Scholar] [CrossRef]
  59. Fomby, T. Scoring Measures for Prediction Problems; Department of Economics, Southern Methodist University: Dallas, TX, USA, 2008. [Google Scholar]
  60. Yang, L.; Shami, A. On hyperparameter optimization of machine learning algorithms: Theory and practice. Neurocomputing 2020, 415, 295–316. [Google Scholar] [CrossRef]
  61. Nokeri, T.C. Forecasting using arima, sarima, and the additive model. In Implementing Machine Learning for Finance: A Systematic Approach to Predictive Risk and Performance Analysis for Investment Portfolios; Apress: Berkeley, CA, USA, 2021; pp. 21–50. [Google Scholar]
Figure 1. Canada’s beef cows in provinces (all inventories in 1000 heads), as of January 2021, reported by StatCan.
Figure 1. Canada’s beef cows in provinces (all inventories in 1000 heads), as of January 2021, reported by StatCan.
Sustainability 16 01789 g001
Figure 2. Alberta fed steer prices (CAD$/cwt) from January 2005 to September 2023.
Figure 2. Alberta fed steer prices (CAD$/cwt) from January 2005 to September 2023.
Sustainability 16 01789 g002
Figure 3. Time-series variations of the predictors from January 2005 to September 2023.
Figure 3. Time-series variations of the predictors from January 2005 to September 2023.
Sustainability 16 01789 g003
Figure 4. Correlation between fed steer price and predictors (p-values < 0.01).
Figure 4. Correlation between fed steer price and predictors (p-values < 0.01).
Sustainability 16 01789 g004
Figure 5. Actual and probabilistic RF predicted normalized cattle prices by RF model on scaled test data from 2005 to 2023. Boxplots show 500 realizations of the probabilistic RF model. The boxes display the median and interquartile range, while the whiskers indicate the 95% interval.
Figure 5. Actual and probabilistic RF predicted normalized cattle prices by RF model on scaled test data from 2005 to 2023. Boxplots show 500 realizations of the probabilistic RF model. The boxes display the median and interquartile range, while the whiskers indicate the 95% interval.
Sustainability 16 01789 g005
Figure 6. Zoomed graph of actual and probabilistic RF-predicted normalized cattle prices using RF model on scaled test data.
Figure 6. Zoomed graph of actual and probabilistic RF-predicted normalized cattle prices using RF model on scaled test data.
Sustainability 16 01789 g006
Table 1. Summary of application of ML to agriculture.
Table 1. Summary of application of ML to agriculture.
AuthorsYear Study DomainConsidered ParametersMachine Learning Technique
Jeong et al.2022South KoreaRice yieldfive different structures of deep learning [15]
Sharma et al.2021Review paperPrecision agriculturea comprehensive review [16]
Liu et al.2021Review paperPrecision agriculturea systematic literature review [17]
Maroli et al.2021Review paperSustainability in agricultural sectora comprehensive review [18]
Meshram et al.2021Review paperPre-harvesting, harvesting, and post-harvesting parametersa comprehensive review on all ML techniques [19]
Tian et al.2021Shaanxi, ChinaWheat yieldlong short-term memory (LSTM), back propagation neural network (BPNN), support vector machine (SVM) [20]
Divisekara et al.2020Canada, Saskatchewan Forecasting the red lentils commodity market priceSARIMA models [21]
Sharma et al.2020Review paperSustainable agriculture supply chain performancea systematic literature review [22]
Kamir et al.2020AustraliaWheat yieldrandom forest (RF), cubist (CU), XGBoost (XGB), multi-layer perceptron (MLP), support vector regression linear (SVMl), support vector regression radial (SVMr), Gaussian process regression (GPR), k-nearest neighbor (kNN), multivariate adaptive regression (MARS) [23]
Yamaç and Todorovic2020Bari, Southern ItalyDaily potato crop evapotranspirationk-nearest neighbour (kNN), artificial neural networks (ANN), adaptive boosting (AdaBoost) [24]
Van Klompenburg
et al.
2020Review paperCrop yield predictiona systematic literature review on artificial neural network (ANN) methods [25]
Vidyarthi et al.2020Kettleman, CaliforniaSize and mass of pistachio kernelsrandom forest (RF) [26]
Cai et al.2019AustraliaWheat yieldLASSO, support vector machine (SVM), random forest (RF), neural network (NN) [27]
Kouadio et al.2018Southern VietnamRobusta coffee yieldextreme learning machine (ELM), multiple linear regression (MLR), random forests (RF) [28]
Prajapati and Kathiriya2016Vadodara in Western IndiaSoil health cardk-nearest neighbor (kNN) classification using nine different similarity measures [29]
Table 2. Annual average price values for key data variables (* 2023 includes January to September).
Table 2. Annual average price values for key data variables (* 2023 includes January to September).
YearFed Steer Price (CAD/cwt)Nat Gas Price (CAD/GJ)Barley Price (CAD/tonne)Exchange (CAD$/USD)Canadian Consumer Price
Index
200585.607.8791.791.2185.44
200686.906.22101.811.1386.93
200788.516.05156.991.0788.30
200890.077.47199.311.0790.15
200985.723.65152.771.1490.85
201089.083.57138.071.0391.93
2011106.473.28174.580.9994.51
2012112.322.14214.241.0096.39
2013119.262.83239.081.0397.17
2014156.514.00173.541.1098.65
2015184.162.42218.801.28100.00
2016153.751.83215.961.33100.81
2017154.932.02193.911.30101.96
2018153.681.29213.361.30103.68
2019149.871.40227.001.33106.03
2020138.941.90215.261.34107.04
2021155.883.10279.611.25111.04
2022173.084.78380.141.30118.44
2023 *222.362.57386.301.35124.01
Table 3. Summary description of the multivariate and univariate ML approaches used in this study.
Table 3. Summary description of the multivariate and univariate ML approaches used in this study.
ModelingAcronymAlgorithmDescription
Multivariate
Models
RFRandom Forest RegressionRFR is an integrated learning method, a general-purpose and quite effective classification and regression approach. It is a technique that ensembles numerous randomized decision trees and averages their predictions.
ABAdaboost RegressorAdaBoost stands as a widely used classification algorithm. Throughout the training process, the sample’s distribution weight is enhanced as the error rate rises; conversely, it diminishes as the new distribution weight decreases. Subsequently, samples are continuously trained based on these altered distribution weights. The objective is to yield robust results by minimizing subsequent model errors, ultimately achieving higher accuracy rates [49,50].
SVMSupport Vector MachinesSVM is a supervised learning strategy that uses a symmetrical loss function that penalizes both high and low misestimates equally, and it has been shown to be an effective method for estimating real-value functions [51]. It has the capability to conduct both linear and non-linear classification and regression. However, dealing with large datasets can be a challenging task [52].
Univariate
Models
ARIMAAuto Regressive Integrated Moving AverageARIMA is a modeling algorithm based on the idea that past values of a time series can be used to predict future values by themselves, also taking into account autocorrelation in the error terms and stationarity.
SARIMASeasonal Auto Regressive Integrated Moving AverageSARIMA is defined as the ‘Seasonal’ ARIMA model, and it is formed by adding seasonal lag and moving average terms to an ARIMA model.
SARIMAXSeasonal Auto Regressive Integrated Moving Average with exogenous factors The SARIMAX model is another form of the SARIMA model with an external predictor, also known as an exogenous variable, e.g., a seasonal index.
Table 4. The hyperparameters with their respective ranges for each algorithm.
Table 4. The hyperparameters with their respective ranges for each algorithm.
RF HyperparameterRF Params Ranges SVR HyperparameterSVR Params RangesAB * HyperparameterAB Params Ranges
Bootstrap[True]C[1, 10, 20]Base estimator max depth[10, 15, 20, 30]
Ccp alpha[0.0]Epsilon[0.1, 1, 10]Learning rate[0.1, 1, 3, 8, 15]
Criterion[‘mse’]Kernel[‘linear’, ‘rbf’, ‘poly’, ‘sigmoid’]N estimators[100, 300, 500]
Min impurity decrease[0.0]----
Min impurity split[None]----
Min samples leaf[1, 2, 4]----
Min samples split[2, 5, 8]----
Min weight fraction leaf[0.0]----
N estimators[100, 300, 500]----
N jobs[None, 1]----
Oob score[False]----
Max features[None, ‘auto’]----
Max samples[None]----
Max leaf nodes[None]----
Max depth[None, 10, 20]----
Random state[None, 1]----
Verbose[0]----
Warm start[False]----
* AB is abbreviation for Adaboost model.
Table 5. Summary statistics of multivariate ML models’ best-selected hyperparameters.
Table 5. Summary statistics of multivariate ML models’ best-selected hyperparameters.
RF HyperparameterRF Best Params SVR HyperparameterSVR Best ParamsAB HyperparameterAB Best Params
BootstrapTrueC20Base estimator max depth10
Ccp alpha0.0Epsilon0.1Learning rate1
CriterionmseKernelsigmoidN estimators100
Min impurity decrease0.0----
Min samples leaf4----
Min samples split5----
Min weight fraction leaf0.0----
N estimators100----
N jobs1----
Max featuresNone----
Max depthNone----
Table 6. Summary statistics of univariate ML models’ best-selected hyperparameters.
Table 6. Summary statistics of univariate ML models’ best-selected hyperparameters.
HyperparameterARIMA SARIMASARIMAX
start_p111
start_q111
max_p333
max_q333
m11210
testadfadfadf
seasonalFalseTrueTrue
traceTrueTrueTrue
start_P000
D011
stepwiseTrueTrueTrue
Table 7. Summary statistics of residuals for the best-selected univariate ML models.
Table 7. Summary statistics of residuals for the best-selected univariate ML models.
HyperparameterARIMASARIMASARIMAX
Best ModelARIMA (0,1,1) (0,0,0) [[0]]ARIMA (0,1,1) (0,1,1) [[12]]ARIMA (1,1,1) (2,1,0) [[10]]
AIC−633.419−585.867−531.422
BIC−627.044−576.513−515.773
Prob (Q)00.230
Prob (JB)000
Heteroskedasticity (H)4.393.154.08
Ljung–Box (Q)78.9046.13101.07
Skew−0.42−0.29−0.08
Table 8. The accuracy metrics of the ML price predicting models on the test data.
Table 8. The accuracy metrics of the ML price predicting models on the test data.
ModelML AlgorithmsMAERMSEMSEMAPEMPERMSPE
MultivariateRF0.1330.1690.02939.145−20.37177.188
AB0.1330.1650.02738.296−17.97572.253
SVR0.1360.1710.02941.980−23.97285.005
UnivariateARIMA0.1870.2620.06824.135−0.39630.529
SARIMA0.1720.2350.05522.788−3.79528.768
SARIMAX0.1640.2300.05321.014−0.04026.520
Table 9. The accuracy metrics of the ML price predicting models on the training data.
Table 9. The accuracy metrics of the ML price predicting models on the training data.
ModelML AlgorithmsMAERMSEMSE
Multivariate RF0.0760.1040.011
AB0.0120.0210.000
SVR0.1070.1450.021
Univariate ARIMA0.0100.0130.000
SARIMA0.0160.0220.000
SARIMAX0.0200.0280.001
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Rahmani, E.; Khatami, M.; Stephens, E. Using Probabilistic Machine Learning Methods to Improve Beef Cattle Price Modeling and Promote Beef Production Efficiency and Sustainability in Canada. Sustainability 2024, 16, 1789. https://0-doi-org.brum.beds.ac.uk/10.3390/su16051789

AMA Style

Rahmani E, Khatami M, Stephens E. Using Probabilistic Machine Learning Methods to Improve Beef Cattle Price Modeling and Promote Beef Production Efficiency and Sustainability in Canada. Sustainability. 2024; 16(5):1789. https://0-doi-org.brum.beds.ac.uk/10.3390/su16051789

Chicago/Turabian Style

Rahmani, Elham, Mohammad Khatami, and Emma Stephens. 2024. "Using Probabilistic Machine Learning Methods to Improve Beef Cattle Price Modeling and Promote Beef Production Efficiency and Sustainability in Canada" Sustainability 16, no. 5: 1789. https://0-doi-org.brum.beds.ac.uk/10.3390/su16051789

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop