em_cpp: C++ version of EM algorithm.

Description Usage Arguments Value Author(s)

Description

C++ version of EM algorithm.

Usage

1
2
em_cpp(x_mat, s_mat, v_mat, pi_vec, itermax = 500L, tol = 10^-5,
  plot_iter = FALSE)

Arguments

x_mat

A matrix of data. The rows index the observations and the columns index the variables.

s_mat

A matrix of variances (NOT standard deviations). The rows index the observations and the columns index the variables.

v_mat

A matrix of initial values for the low-rank mixture covariances.

pi_vec

A vector of initial values of the mixing proportions.

itermax

The maximum number of fixed-point iterations for the EM to run.

tol

The tolerance for the stopping criterion. The current stopping criterion is the ratio of successive likelihoods minus 1.

plot_iter

A logical. Should we plot updates (TRUE) or not (FALSE)?

Value

A list of the following elements:

pi_vec: The final estimate of the mixing proportions.

v_mat: The final estimate of the square roots of the rank-1 covariance matrices. These are the factors.

llike_vec: The vector of log-likelihoods. Should be increasing.

convergence: A value of 0 indicates convergence. A value of 1 indicates that the limit itermax has been reached. A vlue of 2 indicates that the user interupted the optimization.

loadings: An estimate for the loadings.

w_mat: An estimate for the probability of being in a group.

Author(s)

David Gerard


dcgerard/UltimateDeconvolution documentation built on May 15, 2019, 1:24 a.m.