Time Series Analysis of Global Prices of Coffee: Insights into a Complex Market

The global coffee market is a complex and dynamic system influenced by a multitude of factors, resulting in continuous fluctuations in coffee prices. This study utilized time series analysis to examine the historical trends and dynamics of the monthly global price of coffee, Arabica, from January 1990 to July 2023. The data were transformed to achieve stationarity using a methodical process, and an ARIMA (0,1,2) model was found to be the best-fit model for forecasting. The analysis' findings show how complex the coffee market is. Coffee prices are influenced by factors like supply and demand, climate change, currency exchange rates, economic conditions, and trade policies. Since 2001, unstable markets have affected producers and consumers. The COVID-19 pandemic brought unprecedented challenges to the coffee sector, disrupting consumption patterns and supply chains. Economic variables like GDP growth and exchange rates influence coffee prices and producer welfare. While the coffee industry is experiencing recovery, price fluctuations remain a concern. Understanding these factors is crucial for stakeholders, and time series analysis can help inform decision-making in this dynamic market


INTRODUCTION
Coffee is one of the most popular beverages in the world, with millions of people around the world enjoying its rich flavor and stimulating effects.Aside from being a popular beverage, coffee is also a major global commodity with a complex and dynamic market (Samoggia & Riedel, 2019).Arabica (Coffea arabica) and Robusta (Coffea canephora) are the two main species used in coffee production.Arabica coffee is known for its complex flavors and is frequently associated with specialty and high-quality coffee.Robusta, on the other hand, is a stronger and bitterer variety that is commonly used in espresso blends and instant coffee.Arabica and Robusta have come to monopolize the market, with global production projected to be 58% Arabica and 42% Robusta in 2020 (Bermudez et al., 2022).Many factors influence the choice of these species, including climate, altitude, and market demand (Syafriandi et al., 2022).Coffee is grown in several nations along the equatorial belt in Africa, Asia, and the https://ielas.org/ijbe/index.php/ijbeISSN (online) 2545-4137 139 Americas.Among them, Brazil consistently tops the list as the world's top producer of coffee, accounting for a sizeable portion of output worldwide.Vietnam, Colombia, Ethiopia, Honduras, and Peru are additional significant coffee-producing countries, and each is well-known for producing particular coffee varieties (Torok et al., 2018).
Coffee prices fluctuate due to various factors, leading to constant global market fluctuations.Governments in developing countries regulate marketing and pricing for foreign exchange, export earnings, and institutional concerns (Abaunza Osorio, 2009).Coffee, like most agricultural commodities, goes through a complex processing and distribution supply chain.The coffee value chain encompasses all revenues generated by activities performed along the coffee supply chain.A producer price is what coffee producers are paid at the "gate" of the supply chain (Proença et al., 2022).The cost of coffee delivered at the initial port of entry in nations that regularly consume coffee is known as the international price.As a result, coffee export prices from nations that produce coffee are reflected in the global price.The retail price of roasted ground coffee in the US is the national urban rate (Ghoshray & Mohan, 2021).
Between 1995 and 2015, global coffee production increased by 65%, reaching 143 million bags.Major coffee-producing countries like Ethiopia, Brazil, Colombia, and Indonesia saw growth, with Vietnam emerging as a global power (Torok et al., 2018).From 2021 to 2026, the coffee industry, which was worth USD 102 billion in 2020, is anticipated to grow at a CAGR of 4.28% (Bermudez et al., 2022).The top three producers and exporters since 2016 have consistently been Brazil, Vietnam, and Colombia, shipping 33 million, 29 million, and 14 million 60-kg bags, respectively, in 2021-2022.The European Union (EU), the United States, and Japan have consistently been the top three importers during this time, with respective imports of about 43 million, 26 million, and 7 million 60-kg bags in 2021-2022.A 174.3 million bag (60 kilogram) increase in global coffee production is anticipated for 2023-2024(Foreign Agricultural Service, 2023).
Climate change significantly impacts coffee production, with temperature and precipitation patterns affecting crop yields in coffee-growing regions.Disruptions caused by climate change can cause price volatility and supply shocks, affecting the global coffee price.Economy-related variables such as exchange rates, inflation, and income levels in coffee-consuming countries may impact coffee affordability and demand, thereby affecting coffee prices.(Bianco, 2020).In coffee-producing countries, political instability, trade disputes, and government policies can disrupt supply chains and influence coffee prices.As a result, the global coffee market is vulnerable to global geopolitical developments.As consumers and businesses place a greater emphasis on ethical sourcing, rising awareness of sustainability practices such as fair trade and environmentally friendly cultivation may have an impact on coffee prices (Bermudez et al., 2022).
Analyzing the global price of coffee through a broad lens entails looking at several factors.Coffee prices are extremely sensitive to market dynamics such as supply and demand shifts (Bianco, 2020).Coffee is a perfect candidate for time series analysis because of its high sensitivity and complex relationship with the cycle of coffee production and the lag in its response to changing environmental conditions.Every type and quality of coffee has a different price point.The two main bean varieties are Arabica and Robusta, and their costs can vary greatly depending on things like consumer preferences for flavor, production costs, and market demand (Ahmed et al., 2021).One of the most traded commodities worldwide is coffee, which is transported through a complex network of supply chains to consumers all over the world.Understanding coffee trade dynamics, such as shipping, logistics, and tariffs, is essential to understanding price changes (Barreto Peixoto et al., 2023).
Time series analysis is a statistical method used to analyze data over time, particularly in the coffee industry, to understand patterns, trends, and dynamics in production, consumption, pricing, and trade, influenced by economic and natural factors (Ma, 2020).For a wide range of stakeholders, including coffee producers, traders, policymakers, and coffee enthusiasts, this analytical approach can offer insightful information.A useful lens through which to view the intricate and dynamic world of international coffee is time series analysis.We can learn more about the elements that influence this important commodity market by analyzing historical data and looking for patterns, trends, and outliers.Understanding the complexities of time series analysis in the context of global coffee is crucial for making informed decisions and navigating the challenges and opportunities in this constantly changing industry, whether you are a coffee producer, trader, policymaker, or simply a coffee enthusiast (Bermudez et al., 2022).

MATERIALS
The long-term records of monthly global price of coffee, other mild Arabica (units: U.S. cents per pound, monthly, not seasonally adjusted) from January 1990 to July 2023 (Figure 1), is available to the public from International Monetary Fund, Global Price of Coffee, Other Mild Arabica [PCOFFOTMUSDDM], retrieved from FRED, Federal Reserve Bank of St. Louis; https://fred.stlouisfed.org/series/PCOFFOTMUSDM.The average monthly global price of coffee from January 1990 to July 2023 was $137.43U.S cents per pound with a standard deviation of $56.15 (Minimum: $50.83, Maximum: $300.48, and Median: $131.05).

ARIMA Model
A time series is a set of observations, each one being recorded at a specific time t.The sequence of random variables {y t :t = 1, 2, , T} is called a stochastic process and serves as a model for an observed time series.For the Autoregressive Integrated Moving Average (ARIMA) model, the ARIMA (p,d,q) model can be expressed as: y t = ϕ 1 y t-1 + ϕ 2 y t-2 + + ϕ p y t-p + e t + θ 1 e t-1 + θ 2 e t-2 + + θ q e t-q = ∑ i=1 p ϕ i y t-i -∑ j=1 q θ j e t-j + e t where p =the order of the autoregressive process (the number of lagged terms), d = the number of differences required to make the time series stationary, q =the order of the moving average process (the number of lagged terms), ϕ = (ϕ 1 , ϕ 2 , , ϕ p ) is the vector of model coefficients for the autoregressive process, θ = (θ 1 , θ 2 , , θ q ) is the vector of model coefficients for the moving average process, and e t is the residual error (i.e., white noise).The purpose of each of these parts is to make the model better fit to predict future points in a time series (Montgomery et al., 2008).
The SARIMA model is an extension of the ARIMA model that explicitly supports univariate time series with a seasonal component.Statistically, ARIMA (p,d,q) (P,D,Q) S is used to represent the SARIMA model, where P = the order of the seasonal autoregressive process, D = the number of seasonal differences applied to the time series, Q = the order of the seasonal moving average process, and S = the seasonality of the model, i.e., the number of time steps for a single seasonal period.
https://ielas.org/ijbe/index.php/ijbeISSN (online) 2545-4137 142 In time series analysis, the Box-Jenkins methodology (Box & Jenkins, 1970) refers to a systematic method of identifying, estimating, checking, and forecasting ARIMA models (Box et al., 2016), that can be applied to find the best fit of a time series.The Box-Jenkins methodology also can be used as the process for estimating the SARIMA model in this study based on its autocorrelation function (ACF) and partial autocorrelation function (PACF) as a means of determining the stationarity of the univariate time series and the lag lengths of the SARIMA model.
In order to figure out good parameters for the model, Akaike's Information Criterion (AIC) or Bayesian Information Criterion (BIC) can be used to determine the orders of a SARIMA model that is obtained by minimizing the AIC or BIC value.In this study, R 4.3.1 for Windows, an open source for statistical computing and graphics supported by the R Foundation for Statistical Computing, was used as the tool to estimate the model parameters to fit the ARIMA to achieve the purpose of this study.Seasonal adjustment is the estimation and removal of seasonal effects that are not explainable by the dynamics of trends or cycles from a time series to reveal certain non-seasonal features.This can be done by subtracting the estimated seasonal component from the original time series.After removed the seasonal variation, the seasonally adjusted time series only contained the trend component and an irregular component.Since the ACF of the time series, seasonal adjusted monthly global price of coffee, other mild Arabica, from January 1990 to July 2023, showed strong positive statistically significant correlations at up to 27 lags that never decay to zero, and suggested that the time series was non-stationary.

ARIMA Model
In terms of non-stationary time series, differencing can be used to transform a nonstationary time series into a stationary one.When both trend and seasonality are present, thus, both a non-seasonal first difference and a seasonal difference need to apply.The first difference of a time series is the time series of changes from one period to the next.Notice that the graph of the first difference of the time series looked approximately stationary (Figure 3).According to the Augmented Dickey-Fuller Test, Dickey-Fuller = -5.9424with lag order = 7 and the p-value of the test was smaller than 0.01.It rejected the null hypothesis that is non-stationary, and also suggested that the first difference of the time series was stationary.The ACF of first difference shown in Figure 4 showed a steady decay after the first few lags and bounce around between being positive and negative statistically significant.The corresponding PACF of first difference in Figure 5 showed a significant positive spike at the first and second lags followed by correlations that were statistically significant.Seasonal differencing is defined as a difference between a value and a value with lag that is a multiple of seasonality (S).In this case, S = 12 (months per year) is the span of the periodic seasonal behavior.Figure 6 showed the graph of the 12 th difference of the time series, which looked approximately stationary.Meanwhile, the test statistic of the Augmented Dickey-Fuller Test was Dickey-Fuller = -33.838with lag order = 7 and the p-value of the test was smaller than 0.01.It rejected the null hypothesis that is non-stationary, and also suggested that the 12 th first difference of the time series was stationary.Figure 7 showed that ACF most likely a steady decay after the first few lags and bounce around between being positive and negative statistically significant.Meanwhile, Figure 8 showed what PACF mostly looks like a steady negative decay in the partial correlations toward zero.Empirically, the choice of the model order is somewhat arbitrary.In this study, the auto.arima() function from the "forecast" package in R 4.3.1 for Windows was employed to identify both the structure of the series (stationary or not) and type (seasonal or not), and sets the model's parameters, which takes into account the AIC, AICc or BIC values generated to determine the best fit SARIMA model.Consequently, the ARIMA (0,1,2) model was selected to be the best-fit model for the time series, according to the lowest AIC value (= 3024.65) in this study.Given this option, the ARIMA (0,1,2) model was chosen for further forecasting process, and the parameters of the ARIMA (0,1,2) model were presented in Table 1.The Ljung-Box Q-test (Ljung & Box, 1978)

DISCUSSION
The time series plot of the monthly global price of coffee, other mild arabica, January 1990~July 2023 (Figure 1) shows a fluctuation in the global price of coffee over the years.Time series which exhibit a trend or seasonality are non-stationary.Any non-stationary time series can be made stationary after differencing, and after being differentiated, it is said to be integrated of order 1 and denoted by I (1).Any nonseasonal time series that exhibits patterns and is not a random white noise can be modeled with ARIMA models.The price of coffee is influenced by several variables, including supply and demand, currency exchange rates, economic factors, trade policies, and more.This makes the market difficult to navigate for both producers and consumers, as coffee prices can be very volatile, subject to both short-term fluctuations and long-term trends.Since 2001, coffee prices have changed, leading to more unstable prices, particularly for producers (Wyss et al., 2012).Although prices increased and peaked in the 2010-2011 seasons, they have since dropped.Volatility in the coffee futures market protects cafe customers from price increases, but prolonged upward trends in commodity prices may lead to a rise in daily coffee prices (Lewin et al., 2004).The coffee leaf rust epidemic, which decimated coffee plantations throughout Central America and reduced the supply of coffee beans, is likely to blame for the sharp rise in coffee prices that occurred in 2014.As a result, the price of coffee on the futures market shot up.Even though some consumers weren't immediately https://ielas.org/ijbe/index.php/ijbeISSN (online) 2545-4137 148 affected, the long-lasting nature of the crisis eventually led to higher retail prices for coffee.For instance, several large coffee chains in the US, like Starbucks, increased their prices to make up for the rising cost of unroasted coffee beans (Coffee, 2023).
Coffee demand has historically grown by 0.95 percent less for every 1% decline in global GDP growth (Guido et al., 2020).According to Kamaruddin et al., (2021), a 1% change in GDP will cause a 0.68% change in producer prices.This indicates that the price of coffee in the producer market is still influenced by the state of the national economy.Kamaruddin et al., (2021) reported that coffee price increase of 1% on the global market will result in an increase of 0.32% on the producer market, according to a positive shock coefficient of 0.3, while a coffee price decrease of 1% on the international market will result in a decline of 0.89% on the producer market, according to a negative shock coefficient of 0.89.
A strong indicator of an improvement or decline in producer welfare is the difference between how rising and falling coffee prices on the global market affect prices in producer markets (Kamaruddin et al., 2021).Several scientific studies additionally argue that over the next forty years, climate change will probably have an impact on the coffee industry.Due to suitable areas becoming too warm or susceptible to periodic drought, many coffee production areas changed.Due to climate change, the most suitable location becomes unsuitable.Coffee prices will rise as a result of the decline in land suitable for coffee production's impact on the global coffee market (Ebisa, 2017).
Between 2016 and 2019, global coffee prices experienced a significant decrease due to factors such as overproduction, oversupply, currency fluctuations, and economic and political factors.Additionally, the COVID-19 pandemic had a significant impact on coffee prices globally.Lockdowns, social distancing measures, and the closure of cafes and restaurants in many countries contributed to a sharp decline in coffee consumption during the early stages of the pandemic.Out-of-home coffee consumption decreased significantly as more people stayed at home (Maspul, 2020).Global supply chains, including the supply chain for coffee, were also disrupted by the pandemic.For instance, the lockdown caused labor shortages in the regions that produce coffee as well as transportation and logistical issues.
The market was destroyed as soon as the pandemic broke out in early 2020.The decline in coffee consumption caused the coffee industry to face destruction as consumer behavior changed.(Data Bridge Market Research, 2020).However, as more people began going outside and people learned to cope with the global pandemic, coffee consumption and prices started to rise during the second quarter of 2021.In light of the reliance on seasonal labor in many coffee-growing nations, particularly during harvests, COVID-19 was a precursor to fresh shocks for the industry.A recent survey (ICO, 2020)of coffee-exporting countries revealed a deep concern for the loss of labor.An estimated 100,000 and 135,000 workers, respectively, are required in Guatemala and Colombia to complete the harvests.
As of May 2020, many nations that produce coffee, including Colombia, Ethiopia, Brazil, Guatemala, Indonesia, Vietnam, and Honduras, as well as other nations, had imposed internal travel restrictions and shut their external borders.Global coffee production and prices in 2020 and 2021 were impacted by restrictive transborder movement policies in 2020, as well as migrant workers' and farm owners' worries about health and social stigma (Guido et al., 2020).After 2021, the amount of coffee produced increased steadily, but prices of imported coffee have fluctuated and reached low points.International price changes have a greater impact on farmers because, if prices fall below a certain level, farmers may not even be able to cover production costs (Fromm, 2022).

CONCLUSION
The time series plot of monthly global coffee prices spanning from January 1990 to July 2023 paints a dynamic and fluctuating picture of the coffee market (nonstationary).Any non-stationary time series can be made stationary after differencing.After differencing, the data was tested to determine the best-fitted model for forecasting taking into consideration AIC, AICs, and BIC.The ARIMA (0,1,2) model was selected to be the best-fit model for forecasting the monthly global price of coffee.Numerous interrelated factors, such as supply and demand dynamics, climate change, currency exchange rates, prevailing economic conditions, and trade policies, can be blamed for the ups and downs in coffee prices.
Since 2001, the coffee industry, which is known for its volatility, has experienced significant price swings, creating significant difficulties, especially for coffee producers.
Prices peaked in the 2010-2011 seasons, but they then began to slowly decline.Even though price changes may not be immediately felt by customers in cafes around the world, persistent increases in commodity prices can eventually result in higher retail prices for that daily cup of coffee.Coffee prices fell between 2016 and 2019 because of overproduction, currency fluctuations, and societal and political unrest.Lockdowns and reduced outside consumption caused by the pandemic complicated matters even more, sharply reducing demand.A unique set of issues were brought on by the COVID-19 pandemic, which altered consumer behavior and supply chains and affected the coffee industry specifically.Limitations and lockdowns in 2020 decreased demand, which had an impact on coffee prices.The pandemic also had an impact on the labor pool in countries that produced coffee, which had a further impact on production and costing on a global scale.Studies reveal a significant relationship between producer prices, coffee demand, and the expansion of the global economy, highlighting the significance of economic factors in coffee pricing.The dynamics of the global market and producer welfare can be significantly impacted by exchange rates and market shocks, which can significantly change coffee prices.The global coffee market is experiencing recovery amid the pandemic, with increased consumption and prices in 2021, but producers face challenges in covering production costs during low prices.

Figure 1 .
Figure 1.Time Series Plot of Monthly Global Price of Coffee, Other Mild Arabica, January 1990 ~ July 2023 (Source: own work) R 4.3.1 for Windows is an open source for statistical computing and graphics supported by the R Foundation for Statistical Computing was used as the tool to model and forecast the monthly global price of coffee, other mild Arabica, from January 1990 to July 2023 in this study.The function "decompose ()" in R was applied to estimate the seasonal component, trend component, and irregular component of a seasonal time series (Figure 2).The estimated seasonal component definitely displayed seasonality with a pattern recurrence occurring once every 12 months.

Figure 2 .
Figure 2. Decomposition of Monthly Global Price of Coffee, Other Mild Arabica, January 1990 ~ July 2023 (Source: own work)

Figure 3 .
Figure 3.Time Series Plot of First Difference of Seasonal Adjusted Monthly Global Price of Coffee, Other Mild Arabica, January 1990 ~ July 2023 (Source: own work)

Figure 4 .
Figure 4. ACF PlotofFirst Difference of Seasonal Adjusted Monthly Global Price of Coffee, Other Mild Arabica, January 1990 ~ July 2023 (Source: own work)

Figure 6 .
Figure 6.Time Series Plot of 12 th Difference of Seasonal Adjusted Monthly Global Price of Coffee, Other Mild Arabica, January 1990 ~ July 2023 (Source: own work)

Figure 7 .
Figure 7. ACF Plot of 12 th Difference of Seasonal Adjusted Monthly Global Price of Coffee, Other Mild Arabica, January 1990 ~ July 2023 (Source: own work) is a diagnostic tool used to test the lack of fit of a time series model.In this example, the test statistic of the Ljung-Box Q-test was Q=26.02 with 22 degrees of freedom and the p-value of the test was 0.2508 (model degrees of freedom: 2, total lags used: 24), indicating that the residuals were random and that the model provided an adequate fit to the data relatively.Figure9illustratesthat the black line represents the visuals of the monthly global price of coffee dataset without forecasting and the red line represents the visuals of the monthly global price of soy beans data set with forecasted values.The forecasting process with the ARIMA (0,1,2) model indicated a good fit of the ARIMA model for forecasting in this study.

Figure 9 .
Figure 9. Observed and Forecasted Monthly Global Price of Coffee, Other Mild Arabica (Source: own work)