bets.inference: Likelihood inference

Description Usage Arguments Details Value Examples

View source: R/likelihood_inference.R

Description

Likelihood inference

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
bets.inference(
  data,
  likelihood = c("conditional", "unconditional"),
  ci = c("lrt", "point", "bootstrap"),
  M = Inf,
  r = NULL,
  L = NULL,
  level = 0.95,
  bootstrap = 1000,
  mc.cores = 1
)

Arguments

data

A data.frame with three columns: B, E, S.

likelihood

Conditional on B and E?

ci

How to compute the confidence interval?

M

Right truncation for symptom onset (only available for conditional likelihood)

r

Parameter for epidemic growth (overrides {params}, only available for conditional likelihood)

L

Time of travel restriction (required for unconditional likelihood)

level

Level of the confidence interval (default 0.95).

bootstrap

Number of bootstrap resamples.

mc.cores

Number of cores used for computing the bootstrap confidence interval.

Details

The confidence interval is either not computed ("point"), or computed by inverting the likelihood ratio test ("lrt") or basic bootstrap ("bootstrap")

Value

Results of the likelihood inference, including maximum likelihood estimators and individual confidence intervals for the model parameters based on inverting the likelihood ratio test.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
data(wuhan_exported)

data <- subset(wuhan_exported, Location == "Hefei")
data$B <- data$B - 0.75
data$E <- data$E - 0.25
data$S <- data$S - 0.5

# Conditional likelihood inference
bets.inference(data, "conditional")
bets.inference(data, "conditional", "bootstrap", bootstrap = 100, level = 0.5)

# Unconditional likelihood inference
bets.inference(data, "unconditional", L = 54)

# Conditional likelihood inference for data with right truncation
bets.inference(subset(data, S <= 60), "conditional", M = 60)

# Conditional likelihood inference with r fixed at 0 (not recommended)
bets.inference(data, "conditional", r = 0)

bets.covid19 documentation built on July 2, 2020, 2:14 a.m.