Skip to contents

Main function, state space model multiple imputation with unanimous changepoints

Usage

SSMimpute_unanimous_cpts(
  data_ss_ori,
  formula_var,
  ss_param_temp,
  initial_imputation_option = "StructTS",
  estimate_convergence_cri = 0.01,
  lik_convergence_cri = 0.01,
  stepsize_for_newpart = 1/3,
  max_iteration = 100,
  cpt_learning_param = list(cpt_method = "mean", burnin = 1/10, mergeband = 20,
    convergence_cri = 15),
  cpt_initial_guess_option = "ignore",
  dlm_option = "smooth",
  m = 5,
  seed = 1,
  printFlag = T
)

Arguments

data_ss_ori

contains all information, and only selected variables in formula_var enters the state space model

formula_var

select variables from data_ss into the statespace model

ss_param_temp

a list of parameters to set up state-space model

  • m0: initial values for states

  • C0: initial values for variance of states

  • inits: initial values for the estimating of all NA terms, via maximizing likelihood

  • AR1_coeffi: variables, whose coefficient is a AR(1) process; if none, then is NULL

  • rw_coeffi: variables, whose coefficient is a random walk process;if none, then is NULL

  • w_cp_param: variables, whose coefficients are periodic fixed (may shift to other levels over time, but fixed within periods), it contains a list of parameters for each variable whose coefficient level shifts to different values. Details for variable: variable : the name of the variable (Required); segments : how many segments of constant coefficient (Required); changepoints :the corresponding changepoints for the separated segments, it can either be specified by the user or automatically inferred, fixed_cpts only exist when changepoints exists

  • v_cp_param: information about periodic observational variance V (may decrease or increase over time, but fixed within periods), it contains a list of parameters for each variable whose coefficient level shifts to different values. Details for variable: segments : how many segments of constant coefficient (Required); changepoints : the corresponding changepoints for the separated segments, it can either be specified by the user or automatically inferred, fixed_cpts only exist when changepoints exists

initial_imputation_option

for the first iteration of imputing missing y, choose StructTS or others, and can't be "ignore"

estimate_convergence_cri

critic value for convergence check, default 0.01

lik_convergence_cri

critic value for convergence check, default 0.01

stepsize_for_newpart

stepsize specified, default 1/3

max_iteration

max iteration, default 100

cpt_learning_param

a list of variable for change point learning

  • cpt_method: either "mean" or "meanvar"

  • burnin: a positive number in (0,1)

  • mergeband: a positive integer

  • AR1_coeffi: variables, whose coefficient is a AR(1) process; if none, then is NULL

  • rw_coeffi: variables, whose coefficient is a random walk process;if none, then is NULL

  • w_cp_param: variables, whose coefficients are periodic fixed (may shift to other levels over time, but fixed within periods)

  • v_cp_param: information about periodic observational variance V (may decrease or increase over time, but fixed within periods)

cpt_initial_guess_option

option for initially learning cpts in preparation period

dlm_option

choose between smooth or filter

m

number of draws for multiple imputation

seed

random seed

printFlag

whether we need to print the Flag plots.

Value

A list of result