This study analyses South Africa's tourist accommodation sector (2007-2024) using stats SA data and SARIMA modelling. Results show uneven post-Covid recovery, with hotels most resilient. SARIMA outperformed ARIMA, achieving lower RMSE and MAPE, and delivering reliable forecasts to support data-driven tourist policy and planning.
# SA Hotel Occupancy Forecasting
### Statistical Baseline (R) → Deep Learning Upgrade (PyTorch)
> **Can a deep learning model outperform a purpose-built statistical model on highly seasonal time series data?**
> This project answers that question using 18 years of official South African hotel occupancy data running SARIMA in R first to set an honest baseline, then building an LSTM in PyTorch to directly challenge it.
---
## Project Structure
```
sa-hotel-forecasting/
├── README.md
│
├── r/
│ └── sarima_baseline.Rmd ← Stage 1: data cleaning, EDA, ARIMA vs SARIMA
│
└── python/
├── sa_hotel_lstm.py ← Stage 2: PyTorch LSTM upgrade
├── hotel_occupancy.csv ← exported from R (see setup below)
├── sa_hotel_lstm_results.png ← generated on run
└── sa_hotel_lstm_model.pt ← saved model checkpoint
```
---
## Why Two Languages?
This is intentional, not inconsistency. The two stages use the best tool for each job:
| Stage | Language | Why |
|-------|----------|-----|
| Data cleaning, EDA, statistical modelling | **R** | `tidyverse`, `forecast`, and `auto.arima` are the industry standard for time series statistics |
| Deep learning, sequence modelling | **Python / PyTorch** | PyTorch is the dominant framework for neural network research and production ML engineering |
---
## The Data
**Source:** Statistics South Africa Tourist Accommodation Survey
**Period:** January 2007 → June 2025 (18.5 years, 222 monthly observations)
**Target:** Hotel occupancy rate (%) percentage of available rooms occupied each month
**Notable event:** COVID-19 caused a collapse from ~49% average to 1.5% in April 2020
---
## Stage 1 — SARIMA Baseline (R)
**File:** `r/sarima_baseline.Rmd`
The R script handles the full data engineering pipeline and establishes the baseline every subsequent model must beat.
### What it does
- Loads and cleans the raw Stats SA Excel file (drops admin columns, splits H04, parses measurement types, reshapes from wide …