bootstrap_param_est {niaidMI}R Documentation

Estimation of Markov model.

Description

Fits a Markov model then bootstraps the data and refits the model.

Usage

bootstrap_param_est(
  wide,
  b,
  days = paste0("D", 1:28),
  bin = rep(1, length(days) - 1),
  Em = get_emission(wide, days),
  tol = 1e-06,
  maxiter = 200,
  silent = FALSE
)

Arguments

wide

Data in wide format (i.e., each day is a column). See details.

b

Number of bootstrap samples to take.

days

Names of the columns that contain the score for each day.

bin

The assigned bin for pooling together information across transitions. Must be a numeric vector of length=(length(days)-1). By default all transitions are pooled together.

Em

Emission probabilities. Default should be used unless user is advanced.

tol

Tolerance for relative reduction the log-likelihood to determine convergence of the Baum-Welch algorythm.

maxiter

Maximum iterations before stopping the EM algorithm.

silent

Allows silencing some messages.

Details

States for each patient/day in 'wide' may be the following:

Generally the user will not need to call this function directly because it is called by the 'impute' function.

Value

A list object with the following components:

fit

Contains results of the primary model fit

boot

Contains relults from the bootstrap model fit.

bin

The input.

s

Ignor. May be used in future.

days

From input.

Em

From input.

See Also

impute

Examples

test <- sim_data(100)
bs <- bootstrap_param_est(wide=test,b=2)

[Package niaidMI version 1.1.0 Index]