Bayesian regression analysis for forecasting Coca-Cola outlet sales in Dekina, Nigeria, using PyMC and MCMC
## Bayesian Regression Analysis for Forecasting Coca-Cola Outlet Sales in Dekina, Nigeria
## Table of Contents
---
- Project Overview
- Data Sources
- Tools
- Data Cleaning/Preprocessing
- Data Analysis
- Exploratory Data Analysis (EDA)
- Modeling
- Traceplots
- Key Insights from the Model
- Model Accuracy
- Forecasting
- Sales Forecast Plot
- Key Insights from the Forecast Plot
- Business Recommendations
## Project Overview
Accurate sales forecasting is a critical challenge for companies in the fast-moving consumer goods (FMCG) sector. For Coca-Cola outlets in Dekina, Kogi State, Nigeria, demand fluctuates due to seasonality, promotional activities, and holidays, making traditional forecasting methods unreliable. Poor forecasting often results in inventory shortages, wastage, and missed revenue opportunities.
This project applies Bayesian regression analysis to develop a robust, data-driven model for forecasting Coca-Cola sales. Unlike frequentist regression methods, the Bayesian approach integrates prior knowledge, handles uncertainty, and produces probabilistic forecasts—providing not only expected values but also credible intervals that quantify uncertainty.
## Data Sources
The dataset consists of **36 months of sales records** from Coca-Cola outlets in Dekina, Kogi State, Nigeria. It includes the number of crates sold per month along with indicators for **promotions**, **holidays**, and **seasonal cycles** (rainy/dry season). Additional context on holidays and seasonality was obtained from local calendars.
## Tools
- Excel - Data Collection Download here
- Python – Main programming language for data analysis and model building Download here
- Pandas – Data cleaning, manipulation, and preparation of the sales dataset
- NumPy – Numerical computations and array handling
- Matplotlib & Seaborn – Visualization of sales trends, seasonality, and model outputs
- PyMC – Implementation of the Bayesian regression model and probabilistic forecasting
- ArviZ – Diagno …