EStep: Steps of the EM algorithm for a Gaussian Mixture model

Description Usage Arguments Value Author(s) References See Also Examples

Description

Functions to perform the expectation and maximization steps of the EM algorithm for an multivariate Gaussian mixture model.

Usage

1
2
3
EStep(x, theta)

MStep(x, kappa, meta.special.case = FALSE)

Arguments

x

A matrix of observations where rows corresponds to features and columns to experiments.

theta

A list of parameters formatted as described in rtheta.

kappa

A matrix where the (i,j)'th entry is the probability that x[i,] belongs to the j'th component. Usually the returned value of EStep.

meta.special.case

Logical. If TRUE, the maximization step is performed under the special case of Li et. al. (2011). Default values is FALSE.

Value

EStep returns a matrix of probabilities as kappa above.

MStep returns a list of parameters formatted as described in rtheta.

Author(s)

Anders Ellern Bilgrau <anders.ellern.bilgrau@gmail.com>

References

Li, Q., Brown, J. B. J. B., Huang, H., & Bickel, P. J. (2011). Measuring reproducibility of high-throughput experiments. The Annals of Applied Statistics, 5(3), 1752-1779. doi:10.1214/11-AOAS466

See Also

rtheta

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
set.seed(1)
sim <- GMCM:::SimulateGMMData(n = 100)
x <- sim$z
true.theta <- sim$theta
init.theta <- GMCM:::rtheta()  # Generate starting parameters

# Do one EM interation
es <- GMCM:::EStep(x, init.theta)
new.theta <- GMCM:::MStep(x, es)

# Compare current estimate with the true
new.theta
true.theta

Example output

$m
[1] 3

$d
[1] 2

$pie
[1] 0.3985892 0.1700000 0.4314108

$mu
$mu$comp1
[1]   2.518367 -14.419702

$mu$comp2
[1] 13.49153 12.89264

$mu$comp3
[1] -9.134789 -2.551115


$sigma
$sigma$comp1
          [,1]      [,2]
[1,]  15.74861 -10.11403
[2,] -10.11403  10.40673

$sigma$comp2
         [,1]     [,2]
[1,] 9.116592 6.215996
[2,] 6.215996 4.291918

$sigma$comp3
          [,1]      [,2]
[1,] 1.7401099 0.9229792
[2,] 0.9229792 3.2189655


$m
[1] 3

$d
[1] 2

$pie
     pie1      pie2      pie3 
0.2193406 0.3074170 0.4732425 

$mu
$mu$comp1
[1] 13.29799 12.72429

$mu$comp2
[1]   4.146414 -15.399500

$mu$comp3
[1] -9.285670 -2.947204


$sigma
$sigma$comp1
          [,1]     [,2]
[1,] 13.348429 8.850678
[2,]  8.850678 5.934935

$sigma$comp2
           [,1]       [,2]
[1,]  3.0665824 -0.3895294
[2,] -0.3895294  2.6192252

$sigma$comp3
          [,1]      [,2]
[1,] 1.9840226 0.4433423
[2,] 0.4433423 2.8292856

GMCM documentation built on Nov. 6, 2019, 1:08 a.m.