maxthreshold
A function used to optimize the threshold parameter to give the best fit to the data. Optimizes the fit based on R squared.
maxthreshold( data, nsim = 2, IP = 2, method = "deterministic", inits.fit = FALSE, parms, thresholdmin = 2, thresholdmax = 20, printon = FALSE )
data
: The time, cases, births, pop data frame.nsim
: The number of simulations to do.IP
: The infectious period, which should the time step of the data.method
: The forward simulation method used, i.e. deterministic, negbin, pois.inits.fit
: Whether or not to fit initial conditions as well. Defaults to FALSE here. This parameter is more necessary in more chaotic locations.parms
: The estimated parameters from estpars or mcmcestpars.thresholdmin
: The minimum number of cases to be considered an outbreak.thresholdmax
: The max number of cases to be considered an outbreak.printon
: A T/F statement to print the progress.require(kernlab) Mold <- twentymeas[["Mold"]] plotdata(Mold) ## Not run: parms <- estpars(data=Mold,alpha=0.97) tau <- maxthreshold(data=Mold,parms=parms, thresholdmin=8,thresholdmax=12,inits.fit=FALSE) res <- simulatetsir(data=Mold,parms=parms, epidemics='break',threshold=tau,method='negbin',inits.fit=FALSE) plotres(res) ## End(Not run)
Useful links