maxthreshold: maxthreshold

Description Usage Arguments Examples

View source: R/maxthreshold_function.R

Description

A function used to optimize the threshold parameter to give the best fit to the data. Optimizes the fit based on R squared.

Usage

1
2
3
maxthreshold(data, nsim = 2, IP = 2, method = "deterministic",
  inits.fit = FALSE, parms, thresholdmin = 2, thresholdmax = 20,
  printon = FALSE)

Arguments

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.

Examples

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

tsiR documentation built on Aug. 15, 2017, 1:02 a.m.