succotash_em: An EM algorithm for maximizing the SUCCOTASH log-likelihood.

Description Usage Arguments Details Value

Description

Let Y (p by 1) be multivariate normal with mean β + α Z and diagonal covariance Σ, where α and Σ are both known. If β is assumed to be a mixture of normals with known variances and unknown mixing proportions π (p by 1), then this function will maximize the marginal likelihood over Z and π.

Usage

1
2
3
4
5
6
7
succotash_em(Y, alpha, sig_diag, tau_seq = NULL, pi_init = NULL,
  lambda = NULL, Z_init = NULL, itermax = 1500, tol = 10^-6,
  z_start_sd = 1, print_note = FALSE, pi_init_type = c("random",
  "uniform", "zero_conc"), lambda_type = c("zero_conc", "ones"),
  lambda0 = 10, plot_new_ests = FALSE, var_scale = TRUE,
  optmethod = c("coord", "em"), z_init_type = c("null_mle", "random"),
  var_scale_init_type = c("null_mle", "one", "random"))

Arguments

Y

A matrix of dimension p by 1. These are the observed regression coefficients of the observed variables.

alpha

A matrix. This is of dimension p by k and are the coefficients to the confounding variables.

sig_diag

A vector of length p containing the variances of the observations.

tau_seq

A vector of length M containing the standard deviations (not variances) of the mixing distributions.

pi_init

A vector of length M containing the starting values of π. If NULL, then one of three options are implemented in calculating pi_init based on the value of pi_init_type.

lambda

A vector. This is a length M vector with the regularization parameters for the mixing proportions. If NULL then refer to lambda_type.

Z_init

A k by 1 matrix. These are the initial values of the unobserved covariates. If its value is NULL, then each element of Z_init will be drawn from a mean zero normal with standard deviation z_start_sd.

itermax

An integer. The maximum number of fixed-point iterations to run the EM algorithm.

tol

A numeric. The stopping criterion is the absolute difference of the ratio of subsequent iterations' log-likelihoods from 1.

z_start_sd

A positive numeric. If Z_init is NULL, then the starting values for Z are drawn from a mean zero normal with standard devation z_start_sd.

print_note

Should we print that we're doing an EM?

pi_init_type

How should we choose the initial values of π. Possible values of "random", "uniform", and "zero_conc". If "random" then the initial values of π are drawn uniformly over the probability simplex. If "uniform", then each element of pi_init is given mass 1 / M. If "zero_conc" then the last M - 1 elements of pi_init are given mass 1 / p and pi_init[1] is given mass 1 - sum(pi_init[2:M]).

lambda_type

If lambda is NULL, then how should we choose the regularization parameters. Two options are available. If lambda_type is "zero_conc", then lambda[1] = 10 and lambda[2:M] = 1. If lambda_type is "ones" then lambda = 1.

lambda0

If lambda_type = "zero_conc", then lambda0 is the amount to penalize pi0.

plot_new_ests

A logical. Should we plot the new estimates of pi?

var_scale

A logical. Should we update the scaling on the variances (TRUE) or not (FALSE).

optmethod

Should we use coordinate ascent (optmethod = "coord") or an EM algorithm (optmethod = "em").

Details

This function uses the SQUAREM package with fixed point iteration succotash_fixed to run the EM. There can be a lot of local modes, so this function should be run at many starting locations.

Value

pi_vals A vector of length M. The estimates of the mixing proportions.

Z A matrix of dimension k by 1. The estimates of the confounder covariates.

llike A numeric. The final value of the SUCCOTASH log-likelihood.

tau_seq A vector of length M. The standard deviations (not variances) of the mixing distribution.


dcgerard/succotashr documentation built on May 15, 2019, 1:25 a.m.