Coronavirus Dashboard – MCMC Hindcast/Forecast

I wrote a Plotly Reactive Dash app to try to see if I could make an interface to run the MCMC version of the hindcast/forecast model written in R code by James D. Annan and Julia C. Hargreaves (2020) for different country data. I adopted a 3-day exponentially weighted average smoothing scheme to adjust for weekend reporting effects. The original MCMC model is described in the medRxiv preprint by James D. Annan and Julia C. Hargreaves (2020) here:

Model calibration, nowcasting, and operational prediction of the COVID-19 pandemic

James and Julia’s hindcast/forecast model produces excellent results and is continually evolving. See their blog to keep up with latest developments as I am no longer working on the python frontend.

The way the Plotly app I made works is as follows. It imports population data for countries and the daily death data made available by CSSE at Johns Hopkins University together with publicly available lockdown data. These provide the inputs needed by the R code which I created a stripped out executable version from.

The hindcast/forecast simulation itself is manifested by 5000 runs using Monte Carlo Markov Chains (MCMC) for 6 model parameters (see Annan and Hargreaves, 2020 above for details and a description of the SEIR model itself):

Variable 1Latent period [days]
Variable 2Infectious period [days]
Variable 30.5 x Initial infection rate
Variable 4Death rate
Variable 5Initial reproductive rate, R0
Variable 6Post-lockdown reproductive rate, Rt

The MCMC traces, kernel density estimates (KDE) and inter-parameter correlation matrix are displayed in the app. I ran into problems running the R code from within the Plotly Dash environment when deploying at Heroku but it can be run locally for testing purposes. Although I am no longer maintaining this, the codebase for issue checking on Github here:

https://github.com/patternizer/COVID-19-operational-forecast

%d bloggers like this: