Description Usage Arguments Details
Given a time series of symptomatic and asymptomatic infections, and recovered population, calculate the new symptomatic cases at each time period.
1 |
I |
Vector of asymptomatic infections over time. |
Is |
Vector of symptomatic infections over time. |
R |
Vector of recovered/removed population over time. |
dropfirst |
If |
New symptomatic cases are tricky because we have cases entering and leaving the pool. Basically, we look at the change in Is and back out the portion of the change in R that is attributable to recovery from symptomatic cases. Because we assume the recovery rates for symptomatic and asymptomatic cases are equal, this is proportional to the ratio of symptomatic to asymptomatic infections.
Formally:
ras = I / Is
deltaIs = newSympto - deltaRs
deltaR = deltaRs + deltaRa
deltaRa / deltaRs = I/Is = ras
–> deltaR = (1+ras) deltaRs –> deltaRs = deltaR/(1+ras)
newSympto = deltaIs + deltaRs
where deltaX is the change in X from the previous time step.
Because the results depend on differences from the previous time step, we
can't calculate the new cases for the first time step. If the first time
step is the beginning of the infection, then we're looking at an initial
steady state, and the initial difference values are therefore zero, so that's
what we use. If the first data point is in the middle of a run, then this
assumption is no good, and we have to discard the first value. The
dropfirst
argument allows this to happen automatically.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.