Description Usage Arguments Details Value Author(s) References Examples

Besides `print`

and `summary`

methods there are also some standard
extraction methods defined for objects of class `"twinSIR"`

:
`vcov`

, `logLik`

and especially `AIC`

and
`extractAIC`

, which extract Akaike's Information Criterion. Note that
special care is needed, when fitting models with parameter constraints such as
the epidemic effects *α* in `twinSIR`

models. Parameter
constraints reduce the average increase in the maximized loglikelihood - thus
the penalty for constrained parameters should be smaller than the factor 2 used
in the ordinary definition of AIC. To this end, these two methods offer the
calculation of the so-called one-sided AIC (OSAIC).

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ```
## S3 method for class 'twinSIR'
print(x, digits = max(3, getOption("digits") - 3), ...)
## S3 method for class 'twinSIR'
summary(object,
correlation = FALSE, symbolic.cor = FALSE, ...)
## S3 method for class 'twinSIR'
AIC(object, ..., k = 2, one.sided = NULL, nsim = 1e3)
## S3 method for class 'twinSIR'
extractAIC(fit, scale = 0, k = 2, one.sided = NULL,
nsim = 1e3, ...)
## S3 method for class 'twinSIR'
vcov(object, ...)
## S3 method for class 'twinSIR'
logLik(object, ...)
## S3 method for class 'summary.twinSIR'
print(x,
digits = max(3, getOption("digits") - 3), symbolic.cor = x$symbolic.cor,
signif.stars = getOption("show.signif.stars"), ...)
``` |

`x, object, fit` |
an object of class |

`digits` |
integer, used for number formatting with |

`correlation` |
logical. if |

`symbolic.cor` |
logical. If |

`...` |
For the |

`k` |
numeric specifying the "weight" of the |

`one.sided` |
logical or |

`nsim` |
when there are more than two epidemic covariates in the fit, the weights in the OSAIC formula have to be determined by simulation. Default is to use 1000 samples. Note that package quadprog is additionally required in this case. |

`scale` |
unused (argument of the generic). |

`signif.stars` |
logical. If |

The `print`

and `summary`

methods allow the compact or comprehensive
representation of the fitting results, respectively. The former only prints
the original function call, the estimated coefficients and the maximum
log-likelihood value. The latter prints the whole coefficient matrix with
standard errors, z- and p-values (see `printCoefmat`

), and
additionally the number of infections per log-baseline `interval`

,
the (one-sided) AIC and the number of log-likelihood evaluations. They both
append a big “WARNING”, if the optimization algorithm did not converge.

The estimated coefficients may be extracted by using the default
`coef`

-method from package stats.

The two AIC functions differ only in that `AIC`

can take more than one
fitted model object and that `extractAIC`

always returns the number of
parameters in the model (`AIC`

only does with more than one fitted model
object).

Concerning the choice of one-sided AIC: parameter constraints – such as the
non-negative constraints for the epidemic effects alpha in `twinSIR`

models – reduce the average increase in the maximized loglikelihood. Thus,
the penalty for constrained parameters should be smaller than the factor 2
used in the ordinary definition of AIC. One-sided AIC (OSAIC) suggested by
Hughes and King (2003) is such a proposal when *p* out of *k = p + q*
parameters have non-negative constraints:

*
OSAIC = -2 l(theta, tau) + 2 sum_{g=0}^p w(p,g) (k-p+g)*

where *w(p,g)* are *p*-specific weights. For more details see
Section 5.2 in Höhle (2009).

The `print`

methods return their first argument, invisibly, as
they always should. The `vcov`

and `logLik`

methods return the estimated variance-covariance
matrix of the parameters (here, the inverse of the estimate of the
expected Fisher information matrix), and the maximum log-likelihood
value of the model, respectively.
The `summary`

method returns a list containing some summary
statistics of the fitted model, which is nicely printed by the
corresponding `print`

method.
For the `AIC`

and `extractAIC`

methods, see
the documentation of the corresponding generic functions.

Michael Höhle and Sebastian Meyer

Hughes A, King M (2003)
Model selection using AIC in the presence of one-sided information.
*Journal of Statistical Planning and Inference* **115**,
pp. 397–411.

Höhle, M. (2009), Additive-Multiplicative Regression Models for Spatio-Temporal Epidemics, Biometrical Journal, 51(6):961-978.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ```
data("foofit")
foofit
coef(foofit)
vcov(foofit)
logLik(foofit)
summary(foofit, correlation = TRUE, symbolic.cor = TRUE)
# AIC or OSAIC
AIC(foofit)
AIC(foofit, one.sided = FALSE)
extractAIC(foofit)
extractAIC(foofit, one.sided = FALSE)
# just as a stupid example for the use of AIC with multiple fits
foofit2 <- foofit
AIC(foofit, foofit2) # 2nd column should actually be named "OSAIC" here
``` |

surveillance documentation built on July 25, 2018, 1:01 a.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.