logsumexp: Helper functions for the parameter estimation of GMMs

View source: R/mixture.R

logsumexpR Documentation

Helper functions for the parameter estimation of GMMs

Description

These functions are small chunks of code designed to decompose the computation of the EM algorithm into simpler steps. logsumexp returns the computation of equation \log(\exp(sum(x))), avoiding numerical overflows

Usage

logsumexp(l)

predict_posterior_probability(x, estimated_theta)

Arguments

l

a vector of numeric terms

x

the vector of observed values, of size n

estimated_theta

the estimated parameters

Value

a numeric scalar value, result of the previously described equation

a list with two elements:

  • the posterior probability matrix, eta: \eta=(\eta_{i,j}) \in [0, 1]^{n \times k}, with \eta_{i,j} giving the posterior probability of observation i to belong to cluster j

  • loglik returns the expected log-likelihood of our experiment

Functions

  • predict_posterior_probability(): predict_posterior_probability returns the expected probability for each observation to belong to any of the k clusters set a priori, given the estimated parameters


bastienchassagnol/RGMMBench documentation built on Oct. 26, 2023, 5:58 p.m.