em_mixedgc: EM algorithm to fit Gaussian copula

View source: R/em_mixedgc.R

em_mixedgcR Documentation

EM algorithm to fit Gaussian copula

Description

fit the Gaussian copula model from incomplete mixed data

Usage

em_mixedgc(
  Z,
  Lower,
  Upper,
  d_index,
  dcat_index = NULL,
  cat_input = NULL,
  start = NULL,
  trunc_method = "Iterative",
  n_sample = 5000,
  n_update = 1,
  maxit = 50,
  eps = 0.01,
  verbose = FALSE,
  runiter = 0,
  corr_min_eigen = 0.01,
  scale_to_corr = TRUE
)

Arguments

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

start

Initial value of copula correlation

trunc_method

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

n_sample

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

n_update

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

maxit

Maximum number of iterations

eps

Convergence threshold

verbose

Whether to print progress information

runiter

When set as a positive integer, the algorithm will run the specified number of iterations exactly.

corr_min_eigen

If the minimal eigenvalue of a correlation estimate is below corr_min_eigen, it will be regularized to have minimal eigenvalue equal to corr_min_eigen

scale_to_corr

Whether to scale a covariance into a correlation matrix in each EM iteration. For development purpose. Use with caution.

Value

A list containing fitted copula correlation matrix, the likelihood(objective function), Z matrix with updated ordinal entries and a complete imputed Z matrix.

corr

Fitted copula correlation matrix

loglik

The log-likelihood achieved during iteration.

Z

Incomplete Z with approximated observed ordinal mean

Zimp

Complete Z with observed entries the same as Zobs and missing entries imputed


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