fit_nlin: Fits epidemic models using nonlinear aproach

Description Usage Arguments Author(s) Examples

View source: R/fit_nlin.R

Description

Fits epidemic models (Exponential, Monomolecular, Logistic and Gompertz) using nonlinear approach for estimate parameters.

Usage

1
2
3
4
fit_nlin(time,
  y,
  starting_par = list(y0 = 0.01, r = 0.03),
  maxiter = 50)

Arguments

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

Author(s)

Kaique dos S. Alves

Examples

1
2
3
4
5
6
7
8
9
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)

epifitter documentation built on June 14, 2021, 5:08 p.m.