Malawi International
Merchandise Trade Statistics

Data Mining Project · KNIME Analytics Platform · 2022–2025
Philip Katema · SPU 3,000 Records 25 Import Commodities 25 Export Commodities 4 Mining Modules Source: Malawi NSO
Total Imports 2022–2025
$13.1B
USD · 48 months
Total Exports 2022–2025
$3.8B
USD · 48 months
Cumulative Trade Deficit
$9.3B
Exports cover only 28.7% of imports
Tobacco Export Share
50.7%
Single commodity dominance
01

Time Series Forecasting

Linear Regression vs Random Forest · Imports & Exports

Model Performance — Imports
MetricLinear RegressionRandom Forest
0.5460.721
MAE$23.4M$20.6M
RMSE$29.0M$22.7M
MAPE8.7%7.2%
Bias (MSD)-$3.6M-$9.2M
Imports — R² Comparison
Key Finding — Imports
Random Forest explains 72.1% of monthly import variance — a 17.5 percentage point improvement over Linear Regression. The gap reflects non-linear fuel and fertiliser import spikes that linear models cannot capture from lag features alone.
Model Performance — Exports
MetricLinear RegressionRandom Forest
0.5130.638
MAE$19.5M$15.0M
RMSE$21.1M$18.2M
MAPE32.0%24.6%
Bias (MSD)$3.7M$1.0M
Exports — R² Comparison
Key Finding — Exports
Export forecasting is harder than import forecasting across all models — R² values are consistently lower. The high MAPE (24.6% even for RF) reflects Tobacco's auction season spike which dominates export revenue and resists pattern-based prediction without commodity-level price data.
02

Commodity Clustering

k-Means + Hierarchical · 25 Export Commodities · PCA Visualisation

PCA Scatter — Both Algorithms Agree
Cluster — Dominant Outlier
Tobacco Other Exports

PCA dim 0: −5.4 to −3.3 · Behaviourally isolated by both algorithms

Cluster — Mid-Tier Agricultural
TeaPulses GroundnutsMacadamia Nuts Soya Beans

Best diversification candidates · Distinct seasonal patterns

Cluster — Low-Value Mixed
Natural RubberPlastics Scrap MetalSugar

Low value · moderate variability

Cluster — Marginal Mass
CottonCoffee FishRice SpicesApparel ×2 +8 more

14 undifferentiated commodities · near-zero PCA separation

Key Finding — Clustering
Both k-Means and Hierarchical Clustering assign every commodity to identical clusters — 100% algorithm agreement without being provided value data. Tobacco's behavioural uniqueness is confirmed algorithmically: its seasonal auction cycle and scale create a trade signature no other commodity replicates.
04

Anomaly Detection

Rolling Z-Score · 12-Month Window · 4-Tier Classification

Anomaly Count by Category
Z-Score Legend
ANOMALY — Z > 2.0 or Z < −2.0 · Statistically extreme
ELEVATED HIGH — 1.0 < Z ≤ 2.0
ELEVATED LOW — −2.0 ≤ Z < −1.0
NORMAL — −1.0 ≤ Z ≤ 1.0
Four Driving Shocks
Cyclone FreddyMar–Apr 2023
44% Kwacha DevaluationNov 2023
El Niño DroughtJan–Sep 2024
Tanzania Trade DisputeMar–Apr 2025
Selected Anomaly Timeline — Imports & Exports
IMPORTS · Apr 2023
Anomaly Low · Z = −2.394
Acute forex shortage post-Cyclone Freddy. Fuel imports collapsed due to dollar scarcity. Foreign reserves at crisis level — import compression at most severe point in dataset.
EXPORTS · Aug–Nov 2023
Elevated High × 4 months
Pre-devaluation export surge. Buyers locking in contracts before 44% kwacha adjustment (Nov 9 2023). Export values elevated in USD terms as kwacha pressure made Malawi more price-competitive.
IMPORTS · Jan–Apr 2024
Elevated Low × 3 months
Post-devaluation import compression. El Niño dry spells damaged 44% of maize crop. State of disaster declared in 23 of 28 districts (Mar 25 2024).
EXPORTS · Aug 2024
Anomaly High · Z = 2.159
2024 tobacco season record: 40% revenue increase to $396M from $284M. Sales volume up 10% to 133M kg. Average price surged 26.5% to $2.98/kg. Season close in August.
IMPORTS · Jul–Sep 2024
Elevated High × 3 months
Peak El Niño food import response. Government sourcing maize from Argentina and US as regional Zambia/Zimbabwe supply exhausted. WFP Flash Appeal activated for 4.2M food-insecure people.
IMPORTS · Jan 2026
Anomaly High · Z = 2.031 · $390.7M
Structural import surge against already-elevated 2025 baseline ($314.8M rolling mean). Not an isolated spike — culmination of a worsening structural pattern. World Bank: current account deficit near 20% of GDP, forex reserves below 1 month of imports.
Key Finding — Anomaly Detection
All 29 flagged periods across imports and exports trace to four macro shocks. The January 2026 Anomaly High is not an isolated event but the structural capstone of the entire dataset — confirming that Malawi's trade vulnerability is accelerating, not stabilising.
05

Association Rule Mining

Apriori · Min Support 0.3 · Min Confidence 0.6 · Min Lift 1.2

Top Import Association Rules (by Lift)
Antecedent → ConsequentSupportConf.Lift
Nuclear Reactors → Glass and Glassware0.3750.750
1.500
Electrical Machinery → Plastics0.3750.750
1.500
Fats and Oils → Vehicles0.3750.750
1.500
Plastics → Nuclear Reactors0.3540.708
1.417
Cereals → Electrical Machinery0.3540.708
1.417
Ceramic Products → Plastics0.3540.708
1.417
Fertilizer → Diesel and Others0.3540.708
1.417
Soaps → Nuclear Reactors0.3540.708
1.417
Tobacco Substitutes → Electrical Machinery0.3540.708
1.417
Other Made-Up Textiles → Lime0.3540.708
1.417
Import Cluster Groups
Construction Cluster · Lift 1.5

Nuclear Reactors/Boilers ↔ Glass and Glassware. Infrastructure investment and post-disaster reconstruction procurement cycles peak together.

Manufacturing Cluster · Lift 1.5

Electrical Machinery ↔ Plastics. Coordinated intermediate goods procurement by Malawi's manufacturing sector — arrive in same months.

Discretionary Cluster · Lift 1.5

Fats/Oils ↔ Vehicles. Apparently unrelated but share one driver: forex availability. When forex is available, both spike simultaneously.

Top Export Association Rules (by Lift)
Antecedent → ConsequentSupportConf.Lift
Spices → Cotton ⭐ Strongest rule0.3960.792
1.583
Cotton → Spices0.3960.792
1.583
Wooden Furniture → Tea0.3750.750
1.500
Tobacco → Spices0.3750.750
1.500
Macadamia Nuts → Tea0.3750.750
1.500
Skins and Hides → Soya Beans0.3540.708
1.417
Natural Rubber → Macadamia Nuts0.3540.708
1.417
Pulses → Spices0.3540.708
1.417
Beverages → Tobacco0.3540.708
1.417
Scrap Metal → Apparel (Not Knitted)0.3330.667
1.333
Export Cluster Drivers
Harvest Calendar Effect

Tobacco, Tea, Spices, Macadamia Nuts all peak together in Q3 (Jul–Sep). Co-movement reflects Malawi's unified agricultural season — not production interdependencies.

Agro-Ecological Co-Location

Spices ↔ Cotton (Lift 1.583, strongest rule overall) — grown in same southern/central regions by same smallholder communities. Skins/Hides ↔ Soya Beans — livestock and rotation crops from same farms.

Import vs Export — Co-Movement Drivers
The Central Asymmetry
Export co-movement is governed by climate and agricultural geography — commodities co-move because they share growing regions, seasonal calendars, and farmer communities. Import co-movement is governed by a single binding financial constraint: foreign exchange availability. When forex is available, a broad basket of unrelated commodities spikes simultaneously; when scarce, they all drop together. This asymmetry — nature governing exports, finance governing imports — is the most succinct summary of Malawi's structural trade challenge.