fit_nlin | R Documentation |
Fits epidemic models (Exponential, Monomolecular, Logistic and Gompertz) using nonlinear approach for estimate parameters.
fit_nlin(time,
y,
starting_par = list(y0 = 0.01, r = 0.03),
maxiter = 50)
time |
Numeric vector which refers to the time steps in the epidemics |
y |
Numeric vector which refers to the disease intensity |
starting_par |
Starting value for initial inoculun (y0) and apparent infection rate (r). Please informe in that especific order |
maxiter |
Maximun number of iterations |
Kaique dos S. Alves
set.seed(1)
epi1 <- sim_logistic(N = 30,
y0 = 0.01,
dt = 5,
r = 0.3,
alpha = 0.5,
n = 4)
data = data.frame(time = epi1[,2], y = epi1[,4])
fit_nlin(time = data$time, y = data$y, starting_par = list(y0 = 0.001, r = 0.03), maxiter = 1024)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.