Skip to contents

This function applies the bootstrap method to generate a set of simulated samples, estimates model parameters for each sample using the EM algorithm (or MLE), and calculates the confidence intervals for the parameters.

Usage

CI_Bootstrap(
  it = 100,
  final_par,
  model,
  core,
  types,
  n,
  m,
  init_param,
  period = c(0, 1),
  t_list,
  u_list,
  alpha_value = 0.05,
  tol1,
  max_iter,
  parallel = TRUE,
  n_points,
  n_samples,
  n_intervals,
  show_progress = FALSE,
  approx.method
)

Arguments

it

Integer, number of bootstrap iterations (default is 100).

final_par

Numeric vector, the final estimated parameters of the model.

model

Character string, model type, one of "M0", "M1", "M2", "M3", or "M4".

core

Integer, number of cores to use for parallel computation.

types

Character string, the type of data (e.g., "type1", "type2", etc.).

n

Number of units.

m

Number of time.

init_param

Numeric vector, initial parameters for the EM algorithm.

period

Numeric vector, the time interval for the analysis, default is `c(0, 1)`.

t_list

Numeric vector, time points.

u_list

Numeric vector, cycle points.

alpha_value

Numeric, significance level for the confidence interval, default is 0.05.

tol1

Numeric, tolerance for the convergence of the EM algorithm.

max_iter

Integer, maximum number of iterations for the EM algorithm.

parallel

Logical, whether to use parallel computation, default is `TRUE`.

n_points

Integer, the number of points used in the computation.

n_samples

Integer, the number of samples to use in the computation.

n_intervals

Integer, the number of intervals used in the computation.

show_progress

Logical, whether to display the computation progress, default is `FALSE`.

approx.method

Character string, the approximation method to use.

Value

A list containing two elements: - `confidence_intervals`: A data frame containing the estimates, standard errors, and lower and upper bounds of the confidence intervals. - `BT_para`: A matrix containing the parameter estimates from each bootstrap iteration.