Time Series Clustering Analysis for Increases Food Commodity Prices in Indonesia Based on K-Means Method

M. Fariz Fadillah Mardianto, Naufal Ramadhan Al Akhwal Siregar, Steven Soewignjo, Ferdiana Friska Rahmana Putri, Hadi Prayogi, Citra Imama, Dita Amelia, Sediono Sediono, Deshinta Arrova DewiJournal of Human Earth and Future 2024 · DOI

Abstract

The global food crisis has significantly impacted Indonesia's national food sector. This study employs time series clustering, a robust data mining technique, to interpret complex temporal patterns in commodity prices. By utilizing Dynamic Time Warping (DTW) and the K-Means algorithm, the research categorizes ten strategic food commodities based on their price movements from 2020 to 2023. The analysis identifies five optimal clusters influenced by seasonal variations and government policies. These insights provide a foundation for developing targeted price stabilization policies and enhancing food security.

Introduction

Indonesia faces substantial food price volatility driven by a combination of climate change (El Niño/La Niña), the COVID-19 pandemic, and geopolitical tensions such as the Russia-Ukraine war. These factors contribute to inflation and threaten national food security. Traditional economic analyses often struggle with the non-linear and time-shifted nature of price movements. This paper addresses the challenge by grouping commodities based on their behavioral patterns rather than simple categories, allowing for a more nuanced understanding of market pressures.

Methodology

The researchers developed a sophisticated analytical pipeline to process high-dimensional time series data consisting of 157 weekly observations for ten strategic commodities.

Methodology flowchart for K-Means and Dynamic Time Warping (DTW) clustering.

The core of the methodology involves:

  • Dynamic Time Warping (DTW): A measure used to find the optimal alignment between sequences by "warping" the time axis, accounting for lags in price responses.
  • K-Means Clustering with DBA: The K-Means algorithm was adapted using DTW Barycenter Averaging (DBA) to update cluster centroids effectively.
  • Principal Component Analysis (PCA): Used to reduce the dimensionality of the data, facilitating clearer clustering and visualization.
  • Normalization: Min-Max normalization was applied to ensure that absolute price differences (e.g., Beef vs. Chili) did not bias the clustering results.

Key Results and Discussion

The application of the Elbow Method determined that five clusters provided the most accurate representation of price trends among the ten commodities studied.

Visualization of commodity clusters using Principal Component Analysis (PCA).

The resulting clusters revealed non-intuitive groupings:

  • Cluster 1: Cooking Oil, Red Chili, Rice.
  • Cluster 2: Granulated Sugar, Beef.
  • Cluster 3: Chicken Meat, Cayenne Pepper.
  • Cluster 4: Garlic and Shallots.
  • Cluster 5: Chicken Eggs.

The analysis distinguished between relatively stable commodities (Cluster 4) and those highly sensitive to seasonal demand and external shocks (Clusters 2 and 3). For instance, grouping staples like Rice and Cooking Oil with Red Chili suggests these items are influenced by shared macroeconomic factors or interconnected supply chain pressures.

Conclusion and Policy Implications

The study demonstrates that a "one-size-fits-all" approach to price stabilization is inadequate. Instead, the Indonesian government should implement cluster-specific interventions. Establishing a real-time market monitoring system based on these identified clusters would allow for preemptive action. For example, a price spike in one "bellwether" commodity within a cluster could serve as an early warning for others in the same group, enabling more effective and timely policy responses to ensure sustainable economic growth and food security.

Summary updated

Abstract

The global food crisis is perceived to have a significant impact on the national food sector. Time series clustering, a potent data mining technique, is employed to decipher and interpret intricate temporal patterns. Dynamic Time Warping (DTW), a measure that currently appears to be the most relevant, is predicated on the distance between sequences of elements. This paper explores the application of DTW in data mining algorithms to cluster commodity prices in Indonesia, aiming for enhanced accuracy based on time series movement. The clustering algorithm employs the K-Means method, necessitating a comprehensive description of the groups it forms. The analysis results reveal time series clustering for commodity prices using K-Means. Optimal results are achieved with five clusters, based on the commodity price trend. Influencing factors include seasonal variations and government policies related to consumer demand. It is imperative for the government to establish a robust market monitoring system to track commodity price fluctuations in real-time, thereby facilitating the design of effective price stabilization policies. The insights gleaned from this study can guide decision-makers in implementing targeted interventions to stabilize prices, bolster food security, and ensure sustainable economic growth. Doi: 10.28991/HEF-2024-05-03-02 Full Text: PDF
BibTeX
@article{mardianto2024time,
  author = {M. Fariz Fadillah Mardianto and Naufal Ramadhan Al Akhwal Siregar and Steven Soewignjo and Ferdiana Friska Rahmana Putri and Hadi Prayogi and Citra Imama and Dita Amelia and Sediono Sediono and Deshinta Arrova Dewi},
  title = {{Time Series Clustering Analysis for Increases Food Commodity Prices in Indonesia Based on K-Means Method}},
  journal = {Journal of Human Earth and Future},
  year = {2024},
  doi = {10.28991/hef-2024-05-03-02},
}
Figure