Accurate forecasting of prescription demand allows community pharmacies to plan stock, staffing and dispensing capacity, yet most branches still rely on judgement and simple historical averages. This study examines whether traditional time-series models and machine learning techniques can accurately predict patient prescription volumes. Twelve months of prescription records from 162 community pharmacy branches in Bristol, United Kingdom, were used. Branches were segmented with K-means clustering, with the number of clusters selected by the elbow and silhouette methods (K = 2). Because the historical record was short, Monte Carlo simulation was used to generate an extended dataset of 10,000 observations from the cluster-level distributions. Four models were then trained and compared: a seasonal ARIMA (SARIMA) model, a Random Forest Regressor, a Random Forest Classifier and a Long Short-Term Memory (LSTM) recurrent neural network. Performance was measured by Root Mean Square Error (RMSE). The Random Forest Regressor achieved the lowest RMSE (30.987), followed by the LSTM (35.119) and SARIMA (36.829), while the Random Forest Classifier performed poorly (491.704) because the task is a regression problem. The best SARIMA specification, SARIMAX(0,1,1)(0,1,1,12), had an AIC of 789.008 and statistically significant coefficients. The results suggest that ensemble machine learning offers a modest accuracy advantage, while SARIMA remains valuable for its interpretability. A hybrid approach is recommended for operational use.
No takes yet. Share an insight, caveat, or question.
Nene C. T. Onyemari (2026) studied this question.
Synapse has enriched 5 closely related papers on similar clinical questions. Consider them for comparative context: