Data collection and preparation
The study utilized an extensive time series dataset comprising annual measurements of raw buffalo milk production from 1961 to 2021. The dataset was meticulously curated from authoritative agricultural records and sources, ensuring its integrity and reliability. Preprocessing steps were undertaken to address missing values, ensure chronological order and aggregate the annual data into consistent time intervals.
Forecasting models and equations
Various time series models are available in literature which is to be used based on the characteristics of the data. The ability of different models to forecast the time series values is assessed by using forecast evaluation measures. Four distinct forecasting models were considered and applied to capture the temporal patterns in the milk production time series data.
Auto regressive integrated moving average (ARIMA)
The Box-Jenkins ARIMA (p, d, q) model, introduced by Box and Jenkins
Box et al., (2015), stands as a widely employed technique for constructing univariate time series forecasting models. Developed by George Box and Gwilym Jenkins in the 1970s, the ARIMA model provides a mathematical framework for predicting processes. The Box-Jenkins modelling approach encompasses the steps of identifying a suitable ARIMA process, fitting it to the available data, and subsequently employing the established model for predictive purposes. The ARIMA model represents the time series as a function of its own past values, integrating autoregressive (AR), differencing (I), and moving average (MA) components. The general ARIMA (p, d, q) equation is expressed as:
Yt = Ø1 Yt - 1 + Ø2 Yt-2 + ...... + Øp Yt - p + µ - θ1 εt- 1 - θ2 εt - 2- θq εt - q + εt
Where
Y
t = Milk production,
ε
t = Independently and normally distributed with zero mean and constant variance for t=1, 2, ….. , n; and Ø
p and θ
q are also estimated
(Venu et al., 2023: Deshmukh Surendra Sagar and Paramasivam, 2016:
Mahajan Sunali et al., 2020).
Exponential smoothing state space model (ETS)
The Exponential Smoothing State Space Model (ETS) is a forecasting method that combines exponential smoothing with a state space approach (
Mphale and Narasimhan, 2022). ETS models are particularly useful for time series data that exhibit trends and seasonality. Developed to provide a flexible and adaptive framework for time series forecasting, ETS models have gained popularity in both academia and industry. ETS models provide a flexible framework that can handle a wide range of time series patterns, making them suitable for forecasting in diverse applications. The implementation of ETS models is available in various statistical software packages, and they can be adapted to incorporate exogenous variables for improved forecasting accuracy in ETSX models. The flexibility and adaptability of ETS make it a valuable tool for analysts and practitioners dealing with time series forecasting. The basic ETS (A, A, A) model (where “A” stands for additive) can be represented by the following equations:
Level equation: lt = ∝ . yt + (1 - ∝) . (lt -1 + bt - 1)
Trend equation: bt = β . (lt - lt - 1) + (1 - β) . bt - 1)
Seasonal equation: st = γ . (yt - lt - 1 - bt - 1) + (1 - γ) . st - s)
Forecast equation: ŷt + h = lt + h . bt + st + h - s
Where
y
t= Observed value at time,
t.
ŷ
t+h = Forecast for time t+h.
Where,
h = Forecasting horizon,
l
t = Level at time t.
b
t = Trend at time t.
s
t = Seasonal component at time t, α, β.
γ = Smoothing parameters for level, trend and seasonality, respectively.
s = Length of the seasonal cycle.
Simple exponential smoothing (SES)
Simple Exponential Smoothing (SES) is a basic and widely used method for time series forecasting (Ostertagova and Ostertag, 2012). It belongs to the family of exponential smoothing methods, which are designed to capture patterns and trends in time series data. SES is particularly useful when the data does not exhibit complex patterns or seasonality. Simple Exponential Smoothing is a good starting point for time series forecasting, especially when the data has a relatively stable trend and does not exhibit seasonality. It is easy to implement and computationally efficient, making it a practical choice for simple forecasting tasks. However, the appropriateness of SES depends on the specific characteristics of the time series being analysed. The SES equation is as follows:
ŷt + 1 = ∝ . yt + (1 - ∝) . ŷt
Where
ŷ
t+1 = Forecast for the next time period (t+1).
yt = Actual observation at time
t.
ŷ
t = Forecast for time
t.
α = Smoothing parameter.
Also known as the smoothing coefficient, and it takes values between 0 and 1. α determines the weight given to the most recent observation in the smoothing process.
Seasonal naive model
The seasonal naive model is a simple and intuitive time series forecasting method that relies on the observation that many time series exhibit seasonality, where patterns repeat over fixed intervals (
Pala and Atici, 2019). The Seasonal naive model predicts future values based on the most recent observation from the same season in previous periods. While it may not capture all nuances in the data, it serves as a baseline for comparison and is particularly useful when the time series exhibits clear and consistent seasonality. If we denote the time series data as
yt.
Where,
t = Time index and the seasonal period as
s, then the equation for the seasonal naive method is given by:
ŷt = yt - 1
Where,
ŷ
t = Forecast for time t.
y
t-s = Observation from the same season in the previous year, as
s is the seasonal period.
The Seasonal Naive model assumes the next value to be identical to the last observed value at the same seasonal point.
Model evaluation and fitness metrics
Each model was trained on the designated training set and utilized to generate forecasts for the test set. The performance of these models was assessed using common forecast accuracy metrics:
Mean error (ME)
Mean error is the average of all the errors in a set of observations. That is the arithmetic mean of the differences between predicted values and actual values. ME is given by:
n = Number of data points.
P
i = Predicted value for the ith data point.
Q
i = Actual value of the ith data point.
If the mean error is close to zero, it suggests that the observations are accurate. That is, a non-zero ME indicates a bias in the observations. However, sometimes ME might not give the correct picture of accuracy, especially if there are both positive and negative errors that cancel out.
Mean absolute error (MAE)
Mean Absolute Error (MAE) (
Willmott, 2005:
Chai et al., 2014) is a metric used to evaluate the performance of a regression model. It measures the average absolute difference between the actual value and predicted values. The mean absolute error is calculated by:
Where,
n = Number of data points.
P
i= Predicted value for the i
th data point.
Q
i= Actual value of the i
th data point,
ei = Pi - Qi
Root mean squared error (RMSE)
Root Mean Squared Error (
Willmott and Matsuura, 2005;
Chai and Draxler, 2014) is commonly used to evaluate the performance of a predictive model, particularly in regression analysis. It is the quadratic mean of the differences between observed values and actual values, giving more weight to larger errors. RMSE is given by:
n = Number of data points.
P
i = Predicted value for the i
th data point.
Q
i = Actual value of the i
th data point.
Mean absolute percentage error (MAPE)
MAPE (
Moreno, 2013;
Goodwin et al., 1999) is used to assess the accuracy of a forecasting or prediction model, especially in the context of time series analysis. MAPE is expressed as a percentage and measures the average absolute percentage difference between the predicted and actual values. If n is the number of samples.
P
i = Predicted value for the i
th data point.
Q
i= Actual value of the i
th data point, then MAPE is given by;
MAPE provides a clear and intuitive way to assess the accuracy of forecasting models, especially in situations where understanding errors in percentage terms is important. Lower MAPE values indicate better accuracy, with a value of 0 indicating a perfect match between predicted and observed values. However, MAPE is sensitive to zero values in the actual data, which can result in undefined or infinite percentages. Despite such limitations, MAPE is probably the most widely used forecasting accuracy measurement. These metrics were instrumental in evaluating the accuracy and reliability of the models in predicting future milk production values.
Residual analysis
A thorough residual analysis was performed on the ARIMA model to confirm its dependability and assumptions
(Revathi et al., 2023: Jaiswal Priyanka and Bhattacharjee Mahua, 2022). The study included visual inspections, Q-Q plots, histograms and the Autocorrelation Function (ACF) to confirm the distribution's normality and look for any temporal trends or systematic errors. The residuals' absence of evident trends or correlations supported the model's future predictions of oilseed yield accuracy. This research confirmed that the independence, normality, and constant variance assumptions were met, which improved the model's prediction reliability.
Ljung-box test
The Ljung-Box test is a statistical test used in time series analysis to assess whether the residuals from a time series model exhibit significant autocorrelation at different lags
Dare (2022). The test is particularly useful for evaluating the adequacy of the chosen model by examining whether there are any remaining patterns in the residuals that the model has not captured. The Ljung-Box test statistic is based on the sum of the squares of the sample autocorrelations of the residuals at different lags. It is calculated as follows:
Where,
Q = Test statistic, n is the sample size.
p̂k = Sample autocorrelation at lag k.
h = Maximum lag considered.