GMMParameterEstimation.jl Documentation

Introduction

GMMParameterEstimation.jl is a package for estimating the parameters of Gaussian k mixture models using the method of moments for k=2,3,4.

Example of basic use

using GMMParameterEstimation
d = 3
k = 2
diagonal = true
w, true_means, true_covariances = generateGaussians(d, k, diagonal)
sample = getSample(num_samples, w, true_means, true_covariances)
pass, (mixing_coefficients, means, covariances) = estimate_parameters(d, k, sample, diagonal)

Parameter estimation

The main functionality of the package is the estimate_parameters function which estimates parameters for a Gaussian Mixture Model from a sample.

GMMParameterEstimation.estimate_parametersMethod
estimate_parameters(d::Integer, k::Integer, sample::Array{Float64}, diagonal::Bool, w::Array{Float64})

Compute an estimate for the parameters of a d-dimensional Gaussian k-mixture model from a sample.

If diagonal is true, the covariance matrices are assumed to be diagonal. If w is provided it is taken as the mixing coefficients, otherwise those are computed as well. The sample should be a d x sample-size array.

GMMParameterEstimation.unknown_coefficientsMethod
unknown_coefficients(d::Integer, k::Integer, w::Array{Float64}, true_means::Array{Float64,2}, true_covariances::Array{Float64,3}, diagonal::Bool)

Compute parameters and build and solve times for the perfect moment, unknown mixing coefficients case.

Assuming a d dimensional Gaussian k-mixture model with mixing coefficients w, means true_means, and covariances true_covariances.

GMMParameterEstimation.known_coefficientsMethod
known_coefficients(d::Integer, k::Integer, w::Array{Float64}, true_means::Array{Float64,2}, true_covariances::Array{Float64,3}, diagonal::Bool)

Compute parameters for the perfect moment, known mixing coefficients case.

Assuming a d dimensional Gaussian k-mixture model with mixing coefficients w, means true_means, and covariances true_covariances.

Generate random Gaussian k mixtures and samples

Generating random Gaussian k mixtures and sampling from them can be useful for simulation.

GMMParameterEstimation.generateGaussiansMethod
generateGaussians(d::Integer, k::Integer, diagonal::Bool)

Generate means and covariances for k Gaussians with dimension d.

diagonal should be true for spherical case, and false for dense covariance matrices.

GMMParameterEstimation.getSampleMethod
getSample(numb::Integer, w::Vector{Float64}, means::Matrix{Float64}, covariances::Array{Float64, 3})

Generate a Gaussian mixture model sample with numb entries, mixing coefficients w, means means, and covariances covariances.

Build the polynomial systems

GMMParameterEstimation.get1DmomentsMethod
get1Dmoments(sample::Matrix{Float64}, dimension::Integer, m::Integer)

Compute the 1D sample moments 0 through m, for the given dimension of sample.

GMMParameterEstimation.build1DSystemMethod
build1DSystem(k::Integer, m::Integer, a::Union{Vector{Float64}, Vector{Variable}})

Build the polynomial system for a mixture of 1D Gaussians where 'm' is the highest desired moment.

If a is given, use a as the mixing coefficients, otherwise leave them as unknowns.

GMMParameterEstimation.mixedMomentSystemMethod
mixedMomentSystem(d, k, mixing, ms, vs)

Build a linear system for finding the off-diagonal covariances entries.

For a d dimensional Gaussian k-mixture model with mixing coefficients mixing, means ms, and covariances vs where the diagonal entries have been filled in and the off diagonals are variables.

Index