simulate_ci: Confidence envelopes of itnb-object.

View source: R/em-itnb.R

simulate_ciR Documentation

Confidence envelopes of itnb-object.

Description

Simulated confidence envelopes of the parameters estimated by the em_itnb function.

Usage

simulate_ci(
  object,
  level = 0.95,
  trace = TRUE,
  nr_simulations = 2000,
  parametric = FALSE,
  plot = FALSE
)

## S3 method for class 'itnb'
simulate_ci(
  object,
  level = 0.95,
  trace = TRUE,
  nr_simulations = 2000,
  parametric = FALSE,
  plot = FALSE
)

Arguments

object

An itnb-object.

level

Numeric: The confidence level. If left as NULL all parametric bootstrap simulations are returned.

trace

TRUE/FALSE: should a trace be shown?

nr_simulations

Numeric: The number of simulations used to create the confidence envelopes.

parametric

TRUE/FALSE: should the envelopes be simulated using the parametric bootstrap?

plot

TRUE/FALSE: should a density plot of the parameters be returned?

Value

If level = NULL a matrix with bootstrap simulations, otherwise a matrix of lower and upper confidence limits for each parameter.

Examples

n = 2000
i = 94
t = 93
mu = 100
theta = 10
p = 0.2

x <- ritnb(n = n, mu = mu, theta = theta, p = p, i = i, t = t)
m <- em_itnb(x = x, i = i, t = t, control = em_itnb_control(trace = 100))

svilsen/itnb documentation built on Sept. 7, 2024, 1:30 a.m.