index.md

LEMMA

LEMMA (Local Epidemic Modeling for Management and Action) is designed to provide regional (e.g. city or county-level) projections of the SARS-CoV-2 (COVID-19) epidemic under various scenarios. Daily projections with uncertainty bounds are made for hospitalizations, ICU use active cases, and total cases. As detailed below, LEMMA allows for a range of user-specified parameterizations (including on the model structure) and is fit using case series data of COVID-19 hospital and ICU census, hospital admissions, deaths, cases and seroprevalence.

Omicron scenarios for California counties: https://github.com/LocalEpi/LEMMA-Forecasts

Contributors

LEMMA is led by

Additional core collaborators include

Our original Stan implementation was based on the "Santa Cruz County COVID-19 Model" (https://github.com/jpmattern/seir-covid19) by Jann Paul Mattern (UC Santa Cruz) and Mikala Caton (Santa Cruz County Health Services Agency). We are very grateful to Paul and Mikala for generously sharing their code and helping us.

Compartment Diagram

CompartmentDiagram CompartmentLegend

Installation

  1. Install RStudio. (https://rstudio.com/products/rstudio/download/#download)
  2. Create a folder to store your LEMMA inputs and outputs. For example, create a folder "MyFolder" within Documents.
  3. Install toolchain if needed. If you do not have a toolchain including a C/C++ compiler, see here for installing one: https://support.rstudio.com/hc/en-us/articles/200486498
  4. Install LEMMA package.
install.packages("remotes")  #if you do not already have the remotes package
remotes::install_github("LocalEpi/LEMMA")
  1. Copy and paste these lines into the RStudio console:
setwd("~/Documents/MyFolder")   # replace "~/Documents/MyFolder" with the path/folder you created
file.copy(system.file("extdata", "template.xlsx", package = "LEMMA", mustWork = TRUE), "example.xlsx", overwrite = TRUE)

If you get an error something like "lazy-load database 'Library/R/3.6/library/LEMMA/R/LEMMA.rdb' is corrupt" restart R and try step 3 again.

Running LEMMA

  1. Edit the Excel file ~/Documents/MyFolder/example.xlsx and save under a new name. For example, "MyCity.xlsx"
  2. Run the following code.
LEMMA::CredibilityIntervalFromExcel("MyCity.xlsx")

Input

While all inputs can be given in R, the easiest way to get started with LEMMA is to use an Excel file input. The provided Excel spreadsheet provides a template and example of the inputs needed to run LEMMA. These are inputted in 10 sheets.

Sheet 1: Parameters with Distributions

Briefly, LEMMA requires parameters related to the epidemic modeling (e.g., basic reproductive number, duration of infectiousness, percent of infected persons who are hospitalized). LEMMA also allows the user to specify the timing and impact of public health interventions, such as school closures and shelter-in-place orders. Interventions may occur before the current date to reflect such public health interventions. Interventions may also occur after the current date and can be used to simulate epidemic if measures are implemented or lifted at a future date. Explanations for specific parameters are provided below. Users can input a mean and standard deviation for each parameter. Each parameter will be drawn from a normal distribution.

Total infection fatality rate = (Percent of Infected that are Hospitalized * Percent of Hospitalized COVID-19 Patients That are Currently in the ICU * Mortality Rate among ICU COVID-19 Patients) + Percent of infected that die outside of hospital

Sheet 2: Model Inputs

Specify the starting and final date of projections. Note: total population was specified here in previous versions. Total population is now taken from the sum of age bracket populations on Vaccine Distribution

Sheet 3: Interventions

Interventions will be added automatically if not specified here. It is recommended to specify an intervention to represent initial lockdown with Re multiplier = 1/R0.

You can have any number of interventions. If you want more, just add rows using the same format.

Sheet 4: Data

Provide hospital, ICU, death, cases, hospital admissions and/or seroprevalence time series data. PUI (Persons Under Investigation, or "Probable" cases) can be entered if available. Any entries (either an entire column or specific rows) can be left blank if the data is not available.

Sheet 5: Vaccine Distribution

Sheet 6: Vaccine Doses - Observed

- Date - Number of First Doses Pfizer/Moderna: number of new first Pfizer/Moderna doses given - Number of Second Doses Pfizer/Moderna: number of new second Pfizer/Moderna doses given - Number of J&J Doses: number of new (single) Johnson&Johnson doses given

Sheet 7: Vaccine Doses - Future

Future doses for (combined Pfizer and Moderna) and Johnson&Johnson - Date to Begin Increasing Vaccinations: date doses increase beyond baseline - Baseline Number of Daily Doses: number of doses per day after observed doses and before Date to Begin Increasing Vaccinations - Daily Increase in Number of Doses: daily increase (if negative, decrease) - Maximum Doses per Day: maximum number that will be given on any day

Sheet 8: Variants

Note: All vaccine/variant values are modelled as fixed quantities, not parameters with distributions to be estimated

The following can be specified separately for 1 or 2 doses of Pfizer/Moderna and (single dose of) Johnson&Johnson

Sheet 9: PUI Details

If PUIs are used on the Data sheet, a mean for the fraction of PUIs who are actually COVID19 positive can be entered. If PUIs are not used for a given category on the Data sheet, the mean for that category on the PUI Details sheet will be ignored.

Sheet 10: Internal

This allows for more nuanced changes including changing the file names (output.filestr) and plotting details (plot.observed.data.long.term, plot.observed.data.short.term).

Output

Previous versions of LEMMA calculated crediblity intervals and reported quantiles. The current version only calculates a point estimate by maximizing the joint posterior. Future versions may include crediblity intervals again as an option.

PDF output

The main output is provided in pdf format. Plots include short term and long term projections for number hospitalized, in the ICU, cumulative deaths, new hospital admissions, detected cases and seroprevalence (these are only shown for categories in which data was entered on the Data sheet). A plot of Re over time is shown up to 14 days before the last observed data. It is difficult to estimate Re beyond that date because it takes at least two weeks for changes in Re to be reflected in hospitalizations.

Detailed outputs are provided in Excel format.

Sheet 1: Projection

The outputs on the "projection" sheet are all raw values, except seroprev and rt.

Sheet 2: posteriorParams

Posterior mode for each parameter (except interventions).

Sheet 3: posteriorIntervention

Posterior mode for each interventions parameter.

Sheet 4: all.inputs

Text dump of all inputs

FAQ

https://localepi.github.io/LEMMA/articles/faq.html

License

The MIT License (MIT)

Copyright (c) 2021 LEMMA

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.



LocalEpi/LEMMA documentation built on Oct. 30, 2023, 1:11 p.m.