bootstrap_param_est: Estimation of Markov model.

View source: R/bootstrap_param_est.R

bootstrap_param_estR 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:

  • Not missing:An integer from 1 to 8.

  • Missing:NA

  • Partially Missing: range which may be code as a characters string such as '[1,7]' or '[1,2]'. Such a character string indicates that while the actual value is unknown, it is known that the value falls within the specified range.

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)

niaidMI documentation built on March 18, 2022, 7:26 p.m.