Woolz Image Processing  Version 1.7.0
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...
 

Detailed Description

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
nDbnNumber of distributions in the mixture.
nClsNumber of classes in the frequency distribution.
samOrgPosition of first sample (origin).
samItvSample interval.
freqGiven frequency samples.
alphaEstimates of nDbn alpha values, both given and returned. Alpha values must be in the range (0,1].
muEstimates of nDbn mean values, both given and returned.
sdEstimates of nDbn standard deviation values, both given and returned.
tolDifference between two consecutive log liklihood values required to terminate iteration.
sumFreqNumber of observations.
dstLLDestination pointer for the log liklihood.
dstNItnDestination pointer for the number of iterations taken.

References ALC_ER_NONE, AlcDouble2Free(), AlcDouble2Malloc(), AlcFree(), AlcMalloc(), ALG_ERR_CONVERGENCE, ALG_ERR_FUNC, ALG_ERR_MALLOC, and ALG_ERR_NONE.

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
nClsNumber of classes in the frequency distribution.
synFreqBuffer for synthesised frequencies.
nObvNumber of observations.
synOrgOrigin of synFreq buffer.
synStepSample interval for the synFreq buffer.
nDbnNumber of distributions in the mixture.
alphaEstimates of nDbn alpha values.
muEstimates of nDbn mu values.
sigmaEstimates of nDbn standard deviation values.

References ALG_ERR_FUNC, ALG_ERR_NONE, and ALG_NINT.