commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Luc Maisonobe (JIRA)" <>
Subject [jira] [Resolved] (MATH-817) Multivariate Normal Mixture Model Fitting by Expectation Maximization
Date Fri, 29 Mar 2013 15:19:17 GMT


Luc Maisonobe resolved MATH-817.

    Resolution: Fixed

I have reworked a little the indices computations to simplify them.

* totalBins and numComponents have the same value (and both are final int so they never change);
I removed totalBins.
* instead of having binNumber running from 1 to numComponents (inclusive), I used a more traditional
  loop from 0 to numComponents (exclusive), so I replaced binNumber by binIndex, which has
a value
  exactly one unit smaller
* instead of having the inner loop run from minIndex (inclusive) to maxIndex (inclusive),
I also used
  a more traditional loop from minIndex (inclusive) to maxIndex (exclusive)

This way, computing minIndex and maxIndex is very similar, as maxIndex will correspond of
the minIndex for the next bin.
So the loop now reads:
// create a component based on data in each bin
for (int binIndex = 0; binIndex < numComponents; binIndex++) {
    // minimum index (inclusive) from sorted data for this bin
    final int minIndex = (binIndex * numRows) / numComponents;

    // maximum index (exclusive) from sorted data for this bin
    final int maxIndex = ((binIndex + 1) * numRows) / numComponents;

    // number of data records that will be in this bin
    final int numBinRows = maxIndex - minIndex;


    // populate bin and create component
    for (int i = minIndex, iBin = 0; i < maxIndex; i++, iBin++) {

> Multivariate Normal Mixture Model Fitting by Expectation Maximization
> ---------------------------------------------------------------------
>                 Key: MATH-817
>                 URL:
>             Project: Commons Math
>          Issue Type: New Feature
>            Reporter: Jared Becksfort
>            Priority: Minor
>             Fix For: 3.2
>         Attachments: math_817.patch,,,
>   Original Estimate: 1m
>  Remaining Estimate: 1m
> I will submit a class for fitting Multivariate Normal Mixture Models using Expectation
> > Hello,
> >
> > I have implemented some classes for multivariate Normal distributions, multivariate
normal mixture models, and an expectation maximization fitting class for the mixture model.
 I would like to submit it to Apache Commons Math.  I still have some touching up to do so
that they fit the style guidelines and implement the correct interfaces.  Before I do so,
I thought I would at least ask if the developers of the project are interested in me submitting
> >
> > Thanks,
> > Jared Becksfort
> Dear Jared,
> Yes, that would be very nice to have such an addition! Remember to also include unit
tests (refer to the current ones for examples). The best would be to split a submission up
into multiple minor ones, each covering a natural submission (e.g. multivariate Normal distribution
in one submission), and create an issue as described at
> If you run into any problems, please do not hesitate to ask on this mailing list.
> Cheers, Mikkel.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message