# example 1 #
## likelihood for the offspring observations
data(COVID19_JanApr2020_HongKong)
overalllikelihood(
epi.para = list(mean = 1, disp = 0.5, shift = 0.2),
offspring.type = "D",
data = COVID19_JanApr2020_HongKong,
var.name = list(obssize = 'obs'),
obs.type.lab = 'offspring'
)
overalllikelihood(
epi.para = list(mean = 1, disp = 0.5, shift = 0.2),
offspring.type = "D",
data = COVID19_JanApr2020_HongKong$obs,
obs.type.lab = 'offspring'
)
# example 2 #
## likelihood for the next-generation cluster size observations
data(smallpox_19581973_Europe)
overalllikelihood(
epi.para = list(mean = 1, disp = 0.5, shift = 0.2),
offspring.type = 'D',
data = smallpox_19581973_Europe,
var.name = list(obssize = 'obs.clustersize', seedsize = 'obs.seed'),
obs.type.lab = 'nextgen'
)
# example 3 #
## likelihood for the final outbreak size observations
data(MERS_2013_MEregion)
overalllikelihood(
epi.para = list(mean = 1, disp = 0.5, shift = 0.2),
offspring.type = 'D',
data = MERS_2013_MEregion,
var.name = list(obssize = 'obs.finalsize', seedsize = 'obs.seed'),
obs.type.lab = 'outbreak'
)
# example 4 #
## likelihood for more than one types of observations
data(mpox_19801984_DRC)
overalllikelihood(
epi.para = list(mean = 1, disp = 0.5, shift = 0.2),
offspring.type = 'D',
data = mpox_19801984_DRC,
var.name = list(obssize = 'obs.size', seedsize = 'obs.seed', typelab = 'type'),
obs.type.lab = list(offspring = 'offspring', nextgen = 'nextgen', outbreak = 'outbreak')
)
# example 5 #
## reproducing the AIC results in Adam, et al. (2020) https://doi.org/10.1038/s41591-020-1092-0,
## (see Supplementary Table 4),
## where the AIC scores were calculated for NB, Geometric, and Poisson models from top to bottom.
## Here, the AIC is defined as: AIC = -2 * log-likelihood + 2 * number of unknown model parameters.
data(COVID19_JanApr2020_HongKong)
overalllikelihood(
epi.para = list(mean = 0.58, disp = 0.43, shift = 0.2),
offspring.type = "NB",
data = COVID19_JanApr2020_HongKong$obs,
obs.type.lab = 'offspring'
) * (-2) + 2*2
overalllikelihood(
epi.para = list(mean = 0.63, disp = 0.43, shift = 0.2),
offspring.type = "G",
data = COVID19_JanApr2020_HongKong$obs,
obs.type.lab = 'offspring'
) * (-2) + 1*2
overalllikelihood(
epi.para = list(mean = 0.58, disp = 0.43, shift = 0.2),
offspring.type = "P",
data = COVID19_JanApr2020_HongKong$obs,
obs.type.lab = 'offspring'
) * (-2) + 1*2
Run the code above in your browser using DataLab