findBestRe: Find Best Fit for Re

Description Usage Arguments Details Value

View source: R/helper.R

Description

This takes in historical hospitalization data (day.vec and num_actual.vec). Given a fixed set of parameters, it finds the Re that gives the least square error with the data.

Usage

1
findBestRe(model, N, start.exp, num.days, day.vec, num_actual.vec, params)

Arguments

model

String, model to use (either M0, M1, M2)

N

Numeric. Number of people in the area.

start.exp

Numeric. Starting number of exposures.

num.days

Numeric. Number of days to simulate.

day.vec

Vector of numerics.

num_actual.vec

Vector of numerics.

params

List of paramters for SEIR simulation.

Details

The main inputs are day.vec and num_actual vec. Day.vec consists of indices of the historical days relative to the 'set date.' For example, if the date is set as April 1, 2020, and the user provides data from March 28, 29, and 31, then the day.vec = c(-4, -3, -1)

Num_actual.vec is a vector of the values of historical hospitalizations from those dates.

The function returns a list with 'best.re' (The Re with the best fit) and 'best.vals' (a vector of numerics with projected values of hospitalizations on the historical dates for which data was provided).

Value

List with best Re and the projected number of hospitalizations on the historical dates for which data was provided.


lemdt/CovidShinyModel documentation built on May 10, 2020, 1:54 p.m.