bootstrap_param_est: Estimation of Markov model.

Description Usage Arguments Details Value See Also Examples

View source: R/bootstrap_param_est.R

Description

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

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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

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

niaidMI documentation built on Oct. 11, 2021, 9:08 a.m.