confband {rtestim}R Documentation

Add confidence bands to estimated Rt or incidence curves

Description

Create an approximate confidence band for the Rt or incidence estimate. Note that the variance computation is approximate.

Usage

confband(object, lambda, level = 0.95, type = c("Rt", "Yt"), ...)

Arguments

object

a poisson_rt or cv_poisson_rt object.

lambda

the selected lambda. May be a scalar value, or in the case of cv_poisson_rt objects, "lambda.min" or "lambda.max".

level

the desired confidence level(s). These will be sorted if necessary.

type

the type Rt or Yt for confidence intervals of fitted Rt or fitted incident cases

...

additional arguments for methods. Unused.

Value

A data.frame containing the estimates Rt or Yt at the chosen lambda, and confidence limits corresponding to level

Examples

y <- c(1, rpois(100, dnorm(1:100, 50, 15) * 500 + 1))
out <- estimate_rt(y, nsol = 10)
head(confband(out, out$lambda[2]))
head(confband(out, out$lambda[2], level = c(0.95, 0.8, 0.5)))

cv <- cv_estimate_rt(y, nfold = 3, nsol = 30)
head(confband(cv, "lambda.min", c(0.5, 0.9)))

[Package rtestim version 1.0.0 Index]