bets.inference {bets.covid19}R Documentation

Likelihood inference

Description

Likelihood inference

Usage

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



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)



[Package bets.covid19 version 1.0.0 Index]