Difference between revisions of "NMB DASA Covid-19 User Guide"

From Numerus
Jump to navigation Jump to search
Line 103: Line 103:
* Clicking '''run''' when the optimization is stopped will show the progress of the optimization by graphing both the data points and the simulation. When an optimization is stopped or completed, the endpoint of runs used to display the simulation and is given by '''Simulation End''' and initially determined by '''T<sub>fin</sub>''' from the settings page. '''Simulation End''' is ignored during optimization, replaced by '''Fit Range'''. When the optimization is complete the model will run once showing the fit.
* Clicking '''run''' when the optimization is stopped will show the progress of the optimization by graphing both the data points and the simulation. When an optimization is stopped or completed, the endpoint of runs used to display the simulation and is given by '''Simulation End''' and initially determined by '''T<sub>fin</sub>''' from the settings page. '''Simulation End''' is ignored during optimization, replaced by '''Fit Range'''. When the optimization is complete the model will run once showing the fit.
* Clicking '''Forecast''' will produce a single forecast run in anticipation of the forecasting process on the Forecast Page.
* Clicking '''Forecast''' will produce a single forecast run in anticipation of the forecasting process on the Forecast Page.
* For detailed information on each user function, check '''Enable Instructional Popups''' and roll over the element of interest.
For detailed information on each user function, check '''Enable Instructional Popups''' and roll over the element of interest.
 
==MCMC Page==
 
==Forecast Page==
Simulations on this page use the inputs from the optimization page until the time indicated by '''Forecast Onset'''. At that point the state of the model matches the fit achieved by the optimization.
 
Simulation following '''Forecast Onset''' uses the inputs from this page. After each optimization inputs on this page will be (re)set to values from the optimization page. The <span style='color:green;'>green</span> values under the inputs display the optimization values.  If an input is changed a <span style='color:green;'>green</span> value under the input displays the optimization value. If the forecast value is a number, it turns <span style='color:red;'>red</span> to indicate the change. If it is a switch, the green arrow underneath shows the change from optimization position.
 
[[File:fig8.png|200px style="vertical-align:top;"]]

Revision as of 19:04, 4 October 2020

Overview

This WebApp contains a new extended SEIR model and simulation engine for tracking the progress of instances and mortality in the Covid-19 pandemic, based on a set of 20 model parameter inputs. The model and simulation are used to fit sample data and subsequently facilitate forecasting under various conditions.

The user creates a project by:

  • Providing some initial settings for model inputs (default settings are available); and
  • Uploading a CSV file containing sequences of incidence and mortality data over some span of days.

Model data are retained by the WebApp for use on all pages. Data will be retained even if the WebApp is reloaded. Model input settings are first tuned by fitting the simulation to the sample curves up to any point in their length. Forecasting with various scenarios can start at any point of fitting interval of the sample sequence. Forecasting begins with the model initialized to the state determined by the fit.

During forecasting two sets of data are used:

  • Optimization Settings (shown in green) are the results of performing the data fit and are used until a selected Forecast Onset point, chosen in the range of the fit, to initialize the state of the model to the state obtained by the fit. Optimization settings also appear on the settings page.
  • Forecast Settings (shown in red) kick in at the Forecast Onset and may include changes in slider values and switch positions. In particular, enabling the Det_Stoc switch introduces randomness into the simulation during the forecast.

An MCMC Metropolis-Hastings algorithm implementation page produces MCMC distributions for selected parameters. These can be used to select new parameter values for use from the point of Forecast Onset

The Model

A schematic of the model is shown below. Note that it has an expanded number of classes and divides its inputs into Epidemic Parameters and Drivers.



Model.png

Model inputs are organized into two groups:

  • Epidemic Parameters: These are fixed at the beginning of the simulation or at the beginning of a forecast run.
  • Drivers: These are either fixed like the parameters or, if "switched-on" will follow a logistic "ramping up" pattern at a given switch time and with a given slope.



Model1.png

Further details are provided | here

WebApp Organization

The site is organized into these pages:

  • The Settings Page: Create, save, load and edit a project pairing sample data with initial model inputs.
  • The Optimization Page: Select model inputs to vary and perform a Nelder-Mead optimization using an MLE error calculation to fit the data.
  • The Forecast Page: Investigate various future scenarios by changing model inputs with the model tuned according to the optimization.
  • The MCMC Page: Create parameter distributions using the method of Markov chain Monte Carlo (MCMC) for stochastic forecasting.

Important: the WebApp maintains a single database of inputs and other settings. Changes made on any page after initial settings are recorded are propagated to all pages.

Settings Page

Model Settings

Model settings are entered into three tables:

  • Epidemic Parameters: Enter 3 values for each: minimum, preferred, maximum.



Fig1.png

  • Drivers: Entries in this table define the location and shape of the logistic onset for each driver.
Switches on the optimization and forecast page determine the choice of driver values.
Pre-onset values are used throughout if the driver is not "switched on".


Fig2.png
The Epidemic and Driver values entered when the project is being set up are stored as both Optimization and Forecast settings. Later this page can be used to view the changes between these parameter sets by clicking the "Optimization Settings" or "Forecast Settings" radio buttons.

  • Timing Settings
    • Fitting interval [0, Tfit] on which optimization will take place.
    • Data size: Determined by the WebApp when data is uploaded.
    • Simulation start/finish: Simulations currently must start at 0. Forecast end time should exceed the fitting interval.


Fig3.png  Fig4.png


Note: These settings can be overridden on subsequent pages.

Data Input

Select and upload a CSV file containing incidence and mortality data.

Fig5.png Data files must have the format illustrated below:
58,78,72,94,147,185,234,239,573,335,466,...
0,0,0,4,1,5,4,8,2,21,27,28,41,49,36,133,...

Saving Settings

  • Settings can be downloaded and reloaded for later reference.
  • Entries in the Epidemic Parameters and Drivers can also be saved for use with different data sets in other projects.

Optimization

This page is used to fit the model to incidence and mortality data loaded into the project on the settings page.

The initial values of the inputs are set to the values entered on the settings page. We use Nelder-Mead optimization with an MLE error calculation to fit the data curve. To use the optimizer please follow these steps:

  • Select the parameters in the left-hand column that will be allowed to vary during the optimization.

Fig6.png  Fig7.png
Tolerance, Min, Max, Guess 1, and Guess 2 refer to Nelder-Mead parameterization. (Click here for further details regarding the Nelder-Mead algorithm.)
Default values will appear when a parameter is selected and may be overridden.
  • The optimization interval is determined by the Fit Range.
  • Optimizations may be started/stopped and continued using the appropriate buttons.
  • Clicking run when the optimization is stopped will show the progress of the optimization by graphing both the data points and the simulation. When an optimization is stopped or completed, the endpoint of runs used to display the simulation and is given by Simulation End and initially determined by Tfin from the settings page. Simulation End is ignored during optimization, replaced by Fit Range. When the optimization is complete the model will run once showing the fit.
  • Clicking Forecast will produce a single forecast run in anticipation of the forecasting process on the Forecast Page.

For detailed information on each user function, check Enable Instructional Popups and roll over the element of interest.

MCMC Page

Forecast Page

Simulations on this page use the inputs from the optimization page until the time indicated by Forecast Onset. At that point the state of the model matches the fit achieved by the optimization.

Simulation following Forecast Onset uses the inputs from this page. After each optimization inputs on this page will be (re)set to values from the optimization page. The green values under the inputs display the optimization values. If an input is changed a green value under the input displays the optimization value. If the forecast value is a number, it turns red to indicate the change. If it is a switch, the green arrow underneath shows the change from optimization position.

200px style="vertical-align:top;"