JWS C Library
C language utility library
bmm.h File Reference

Bernoulli mixture model and parameter fitting using EM. More...

#include <jwsc/config.h>
#include <stdlib.h>
#include <inttypes.h>
#include "jwsc/vector/vector.h"
#include "jwsc/matrix/matrix.h"
#include "jwsc/matblock/matblock.h"
Include dependency graph for bmm.h:

Go to the source code of this file.

Functions

double bmm_log_likelihood_d (const Matrix_d *mu, const Vector_d *pi, const Matrix_u32 *x)
 Computes the double precision Bernoulli mixture model log-likelihood.
void bmm_kmeans_init_d (Matrix_d **mu_out, Vector_d **pi_out, const Matrix_u32 *x, uint32_t K)
 Initializes the double precision Bernoulli mixture model using the kmeans clustering algorithm.
void train_bmm_d (Matrix_d **mu_out, Vector_d **pi_out, const Matrix_u32 *x, uint32_t K)
 Trains a double precision Bernoulli mixture model.

Detailed Description

Bernoulli mixture model and parameter fitting using EM.

Author:
Joseph Schlecht
License:
Creative Commons BY-NC-SA 3.0

Definition in file bmm.h.


Function Documentation

double bmm_log_likelihood_d ( const Matrix_d mu,
const Vector_d pi,
const Matrix_u32 x 
)

Computes the double precision Bernoulli mixture model log-likelihood.

Parameters:
muMultivariate Bernoulli means.
piMixture component weights.
xBinary data.

Definition at line 173 of file bmm.c.

void bmm_kmeans_init_d ( Matrix_d **  mu_out,
Vector_d **  pi_out,
const Matrix_u32 x,
uint32_t  K 
)

Initializes the double precision Bernoulli mixture model using the kmeans clustering algorithm.

If one of the arguments is already allocated, it is assumed to be initialized as well.

Minimum cluster membership is 1 sample.

Parameters:
mu_outMultivariate Bernoulli parameters.
pi_outMixture component weights.
xData.
KNumber of mixture components.

Definition at line 232 of file bmm.c.

void train_bmm_d ( Matrix_d **  mu_out,
Vector_d **  pi_out,
const Matrix_u32 x,
uint32_t  K 
)

Trains a double precision Bernoulli mixture model.

If *mu_out and *pi_out are not initialized, bmm_kmeans_init_d() is used to do so.

Parameters:
mu_outResult parameter. Parameters for mixture components.
pi_outResult parameter. Mixture component weights.
xData to train the BMM with.
KNumber of mixture components.

Definition at line 311 of file bmm.c.