impute_em: impute_em

Description Usage Arguments Value Author(s) See Also Examples

Description

Impute missing components in X using the EM algorithm, assuming each row is a sample of multivariate normal distribution.

Usage

1
impute_em(X, max_iter = 3000, eps = 1e-08)

Arguments

X

A data or a matrix with or without NA's.

max_iter

A natural number; the number of iterations. 3000 by default.

eps

A small positive number; 1e-08 by default.

Value

A list:

Author(s)

Junkyu Park

See Also

simulate_na, Imputing missing data using EM algorithm

Examples

1
2
3
4
5
6
7
set.seed(1024)
mu <- c(1, 2, 6)
Sigma <- matrix(c(118, 62, 44, 62, 49, 17, 44, 17, 21), nrow = 3)
n <- 400
X_truth <- MASS::mvrnorm(n = n, mu = mu, Sigma = Sigma)
result <- simulate_na(X_truth, na_rate = .4)
result_imputed <- impute_em(result$X)

joon3216/funpark documentation built on June 18, 2019, 7:32 a.m.