Forecasting Critical Drug Demand with Markov Models
Context
A Paraguayan public hospital faced recurrent shortages of chronic cardiovascular medications. Demand was volatile, and procurement didn’t rely on data.
I built a Markov-chain forecasting system to anticipate shortages and guide inventory decisions.
What I Built
A forecasting engine that:
Models patient consumption patterns using Markov states
Predicts future demand for critical medications
Provides early alerts on stockouts
Converts patient transitions directly into pill-level demand forecasts
Approach
Analyzed historical withdrawal records for four major cardiovascular drugs
Defined discrete consumption states + transition probabilities
Evaluated four Markov-based model configurations
Validated accuracy with MAPE across rolling windows
Translated state forecasts into drug-level demand and inventory trajectories
Key Findings
Found that a model incorporating additive expansion factors to capture population shifts delivered the most consistent accuracy across drugs and evaluation windows.
The system predicted a cardiovascular drug stockout four months in advance
Markov transitions revealed hidden patient-behavior patterns influencing demand
Model performance varied by drug, highlighting the need for flexible model selection
Impact
Enabled earlier procurement decisions to reduce stockout risk
Improved inventory reliability without increasing cost
Introduced a repeatable forecasting workflow applicable to other chronic conditions (e.g., insulin)
Provided leadership with a data-driven planning tool instead of reactive ordering
Tools & Techniques
Markov Chains • Stochastic Processes • Demand Forecasting • Python