fitsir: fitting function

Description Usage Arguments See Also Examples

Description

fitting function

Usage

1
2
3
4
fitsir(data, start, dist = c("gaussian2", "gaussian", "poisson",
  "quasipoisson", "nbinom", "nbinom1"), type = c("prevalence",
  "incidence", "death"), method = "BFGS", control = list(maxit =
  1e+05), tcol = "times", icol = "count", debug = FALSE, ...)

Arguments

data

data frame

start

starting parameters

dist

conditional distribution of reported data

type

type of reported data

method

optimization method (see mle2)

control

control parameters for optimization

tcol

column name for time variable

icol

column name for count variable

debug

print debugging output?

...

Further arguments to pass to optimizer

optimizer

optimizer to be used (see mle2)

See Also

startfun mle2

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
harbin2 <- setNames(harbin,c("times","count"))
(f1 <- fitsir(harbin2, 
              start=c(beta=2, gamma=1, N=2e3, i0=0.0001, sigma=10),
              type="death"))
plot(f1)

## CRUDE R^2 analogue (don't trust it too far!)
ss <- SIR.detsim(harbin2$times,trans.pars(coef(f1)), type="death")
cc <- harbin2$count

cor(ss, cc)^2

f1_g2 <- fitsir(harbin2, 
             start=c(beta=2, gamma=1, N=2e3, i0=0.0001),
              family="gaussian2",
              type="death")
plot(f1)

bbolker/fitsir documentation built on June 4, 2019, 8:28 a.m.