Woolz Image Processing  Version 1.7.5
AlgMixture

## Files

file  AlgMixture.c
Provides a function for computing the maximum liklihood parameters of a mixture of distributions which fit the given data.

## Functions

AlgError AlgMixtureMLG (int nDbn, int nCls, double samOrg, double samItv, double *freq, double *alpha, double *mu, double *sd, double tol, double sumFreq, double *dstLL, int *dstNItn)
Computes the maximum liklihood estimate of the parameters of a mixture of normal distributions which best fit the give frequencies. These parameters are the miximg proportions, means, and standard deviations. The log-liklihood and the number of iterations are also computed. This algorithm is based on the article: Agha M. and Ibrahim M.T. Maximum Liklihood Estimation of Mixtures of Distributions AS203 Applied Statistics 33(3):327-332, 1984. More...

AlgError AlgMixtureSyn (int nCls, int *synFreq, int nObv, double synOrg, double synStep, int nDbn, double *alpha, double *mu, double *sigma)
Synthesise a mixture of normal distributions. More...

## Function Documentation

 AlgError AlgMixtureMLG ( int nDbn, int nCls, double samOrg, double samItv, double * freq, double * alpha, double * mu, double * sd, double tol, double sumFreq, double * dstLL, int * dstNItn )

Computes the maximum liklihood estimate of the parameters of a mixture of normal distributions which best fit the give frequencies. These parameters are the miximg proportions, means, and standard deviations. The log-liklihood and the number of iterations are also computed. This algorithm is based on the article: Agha M. and Ibrahim M.T. Maximum Liklihood Estimation of Mixtures of Distributions AS203 Applied Statistics 33(3):327-332, 1984.

Returns
Error code.
Parameters
 nDbn Number of distributions in the mixture. nCls Number of classes in the frequency distribution. samOrg Position of first sample (origin). samItv Sample interval. freq Given frequency samples. alpha Estimates of nDbn alpha values, both given and returned. Alpha values must be in the range (0,1]. mu Estimates of nDbn mean values, both given and returned. sd Estimates of nDbn standard deviation values, both given and returned. tol Difference between two consecutive log liklihood values required to terminate iteration. sumFreq Number of observations. dstLL Destination pointer for the log liklihood. dstNItn Destination pointer for the number of iterations taken.

Referenced by WlzHistogramFitPeaks().

 AlgError AlgMixtureSyn ( int nCls, int * synFreq, int nObv, double synOrg, double synStep, int nDbn, double * alpha, double * mu, double * sigma )

Synthesise a mixture of normal distributions.

Returns
Error code.
Parameters
 nCls Number of classes in the frequency distribution. synFreq Buffer for synthesised frequencies. nObv Number of observations. synOrg Origin of synFreq buffer. synStep Sample interval for the synFreq buffer. nDbn Number of distributions in the mixture. alpha Estimates of nDbn alpha values. mu Estimates of nDbn mu values. sigma Estimates of nDbn standard deviation values.

References ALG_ERR_FUNC, ALG_ERR_NONE, and ALG_NINT.