fit_SEIQRDP {genSEIR} | R Documentation |
Fit SEIQRDP function
Description
Fit SEIQRDP function parameters used in the SEIQRDP function, used to model the time-evolution of an epidemic outbreak.
Usage
fit_SEIQRDP(
Q,
R,
D,
Npop,
E0,
I0,
time,
alpha = 0.05,
dt = 1/24,
guess,
ftol = sqrt(.Machine$double.eps),
ptol = sqrt(.Machine$double.eps),
gtol = 0,
diag = list(),
epsfcn = 0,
factor = 100,
maxfev = integer(),
maxiter = 1000,
nprint = 1,
trace = TRUE,
...
)
Arguments
Q |
time histories of the active cases |
R |
time histories of the recovered cases |
D |
time histories of the deceased cases |
Npop |
total population of the country |
E0 |
initial number of exposed cases |
I0 |
initial number of predicted infectious cases |
time |
a time vector |
alpha |
type I error rate, default is 0.05 |
dt |
the time step. This oversamples time to ensure that the algorithm converges |
guess |
initial guess parameters |
ftol |
nls.lm.control object. non-negative numeric. Default is |
ptol |
nls.lm.control object. non-negative numeric. Default is |
gtol |
nls.lm.control object. non-negative numeric. Default is |
diag |
nls.lm.control object. a list or numeric vector containing positive entries that serve as multiplicative scale factors for the parameters. |
epsfcn |
nls.lm.control object. Default is |
factor |
nls.lm.control object. Default is |
maxfev |
nls.lm.control object. Default is |
maxiter |
nls.lm.control object. Default is |
nprint |
nls.lm.control object. Default is |
trace |
set |
... |
further arguments |
Value
a list of optimized parameters
Author(s)
Selcuk Korkmaz, selcukorkmaz@gmail.com
References
Peng, L., Yang, W., Zhang, D., Zhuge, C., Hong, L. 2020. “Epidemic analysis of COVID-19 in China by dynamical modeling”, arXiv preprint arXiv:2002.06563.
See Also
Examples
start = "01/01/21"
finish = "04/01/21"
country = "Italy"
dt = 1
f=30
covidData = getDataCOVID(start = start, finish = finish, country = country)
Recovered = covidData$tableRecovered
Deaths = covidData$tableDeaths
Confirmed = covidData$tableConfirmed
if(nrow(Recovered) == 1){
name = Recovered$CountryRegion
}else{
name = paste0(Recovered$ProvinceState, " (",Recovered$CountryRegion,")")
}
recovered = Recovered[ ,5:ncol(covidData$tableRecovered)]
deaths = Deaths[ ,5:ncol(covidData$tableDeaths)]
confirmed = Confirmed[ ,5:ncol(covidData$tableConfirmed)]
Npop = 60000000
alpha_guess = 0.05
beta_guess = 0.8
LT_guess = 7
Q_guess = 0.8
lambda_guess = c(0.01,0.001,10)
kappa_guess = c(0.001,0.001,10)
guess = list(alpha_guess,
beta_guess,
1/LT_guess,
Q_guess,
lambda_guess[1],
lambda_guess[2],
lambda_guess[3],
kappa_guess[1],
kappa_guess[2],
kappa_guess[3])
Q0 = confirmed[1]-recovered[1]-deaths[1]
I0 = 0.3*Q0
E0 = 0.3*Q0
R0 = recovered[1]
D0 = deaths[1]
Active = confirmed-recovered-deaths
Active[Active<0] <- 0
Q=Active
R=recovered
D = deaths
time = seq(as.Date(start, format = "%m/%d/%y"), as.Date(finish, format = "%m/%d/%y"), by = "1 day")
params = fit_SEIQRDP(Q = Active, R = recovered, D = deaths, Npop = Npop, E0 = E0, I0 = I0,
time = time, alpha = 0.05, dt = dt, guess = guess, ftol = 1e-6,
ptol = 1e-6, gtol = 1e-6, epsfcn = 0.001, factor = 100, maxfev = 1000,
maxiter = 100, nprint = 1, trace = TRUE)