latent_operation: Operation to conduct in the latent space

View source: R/iteration_func.R

latent_operationR Documentation

Operation to conduct in the latent space

Description

Conduct one of three tasks in the latent space. If task = "em", conduct an em iteration. If task = "fillup", impute the missing entries of Z as their conditional mean. If task = "sample", conduct multiple imputation on the missing entries of Z.

Usage

latent_operation(
  task,
  Z,
  Lower,
  Upper,
  d_index,
  dcat_index,
  cat_input,
  corr,
  trunc_method = "Iterative",
  n_update = 1,
  n_sample = 5000,
  n_MI = 1
)

Arguments

task

Task to perform. One of "em", "fillup", "sample".

Z

Transformed latent matrix

Lower

Lower boundary of truncated intervals

Upper

Upper boundary of truncated intervals

d_index

Boolean vector with TRUE at ordinal dimensions

dcat_index

Boolean vector with TRUE at categorical dimensions

cat_input

Input for categorical dimensions

corr

Current copula correlation estimate

trunc_method

Method for evaluating truncated normal moments: 'Iterative' or 'Sampling'.

n_update

The number of updates, only used when trunc_method is 'Iterative'

n_sample

Number of MC samples, only used when trunc_method is 'Sampling'

Value

A list containing

corr

Available when task = 'em'. Updated correlation estimate.

loglik

Available when task = 'em'. The average log-likelihood.

Z

Available when task = 'em'. Incomplete Z with updated observed ordinal entries

Zimp

Available when task = 'em' or task == 'fillup' . Complete Z with observed entries the same as Z and missing entries imputed

Zimp_sample

Available when task = 'sample'. Multiple imputation samples.

C

Available when task = 'em'. The conditional co-variance due to missingness

var_ordinal

Available when task = 'em' or task = 'fillup'. The conditional variance due to truncation, i.e. Var(z|a < z < b)


udellgroup/mixedgcImp documentation built on Jan. 25, 2023, 7:55 p.m.