Skip to contents

This function models a smooth transition between two reproduction numbers (\(R_0\) and \(R_1\)) over time using a logistic curve.

Usage

logistic_function(t, R0, R1, r, t0)

Arguments

t

A numeric value or vector representing the time point(s) at which to calculate the reproduction number.

R0

A numeric value representing the initial reproduction number (\(R_0\)).

R1

A numeric value representing the final reproduction number (\(R_1\)).

r

A numeric value representing the growth rate or steepness of the logistic transition.

t0

A numeric value representing the midpoint of the transition where the reproduction number is halfway between \(R_0\) and \(R_1\).

Value

A numeric value or vector representing the reproduction number at each time point in t.

Details

The function computes the reproduction number using the logistic equation: $$R(t) = \frac{R_1 - R_0}{1 + \exp(-r \cdot (t - t_0))} + R_0$$

This models a smooth, sigmoidal transition from \(R_0\) to \(R_1\) over time.

Examples

# Transition from R0 = 2.5 to R1 = 1.0 over time
times <- seq(0, 10, by = 0.1)
reproduction_numbers <- logistic_function(times, R0 = 2.5, R1 = 1.0, r = 0.5, t0 = 5)
plot(times, reproduction_numbers, type = "l", main = "Logistic Transition of Reproduction Number")