BDMLIB
Estimate Dirichlet Mixture Weights
BDMLIB
is a FORTRAN90 library which
estimates the weights
W in a Dirichlet mixture PDF (probability density function)
by analyzing events that were generated by the mixture.
To generate "events", first one of the component Dirichlet PDF's
is chosen based on the weights W. Then the Dirichlet PDF, whose
parameters ALPHA are known, is used to generate a probability
vector P. This probability vector is then used with the multinomial
PDF to generate an integer vector X, which is the result.
Now, we assume that we are watching this process, and have no
knowledge of the weights W. Simply by observing the result vectors
X, we will try to estimate the values of the W's.
A pseudoBayesian process is used to do this.
Licensing:
The computer code and data files made available on this web page
are distributed under
the GNU LGPL license.
Languages:
BDMLIB is available in
a FORTRAN77 version and
a FORTRAN90 version.
Related Data and Programs:
ASA266,
a FORTRAN90 library which
evaluates various properties of a Dirichlet distribution.
GETWGT,
a FORTRAN90 library which
estimates the parameters of a Dirichlet mixture.
Reference:

Joachim Ahrens, Ulrich Dieter,
Computer Methods for Sampling From the
Exponential and Normal Distributions,
Communications of the ACM,
Volume 15, Number 10, October 1972, pages 873882.

Joachim Ahrens, Ulrich Dieter,
Generating Gamma Variates by a Modified Rejection Technique,
Communications of the ACM,
Volume 25, Number 1, January 1982, pages 4754.

Joachim Ahrens, KlausDieter Kohrt, Ulrich Dieter,
Algorithm 599:
Sampling from Gamma and Poisson Distributions,
ACM Transactions on Mathematical Software,
Volume 9, Number 2, June 1983, pages 255257.

Jerry Banks, editor,
Handbook of Simulation,
Wiley, 1998,
ISBN: 0471134031,
LC: T57.62.H37.

Carl Branden, John Tooze,
Introduction to Protein Structure,
Second Edition,
Garland Publishing, 1999,
ISBN: 0815323050,
LC: QP551.B7635.

William Cody, Kenneth Hillstrom,
Chebyshev Approximations for the Natural Logarithm of the
Gamma Function,
Mathematics of Computation,
Volume 21, Number 98, April 1967, pages 198203.

Luc Devroye,
NonUniform Random Variate Generation,
Springer, 1986,
ISBN: 0387963057,
LC: QA274.D48.

Brian Everitt, David Hand,
Finite Mixture Distributions,
Chapman and Hall, 1981.

John Hart, Ward Cheney, Charles Lawson, Hans Maehly,
Charles Mesztenyi, John Rice, Henry Thacher,
Christoph Witzgall,
Computer Approximations,
Wiley, 1968,
LC: QA297.C64.

William Kennedy, James Gentle,
Statistical Computing,
Marcel Dekker, 1980,
ISBN: 0824768981,
LC: QA276.4.K46.

Kenneth Lange,
Mathematical and Statistical Methods for Genetic Analysis,
Springer, 1997,
ISBN: 0387953892,
LC: QH438.4.M33.L36.

AFM Smith, Udi Makov,
A QuasiBayes Sequential Procedure for Mixtures,
Journal of the Royal Statistical Society,
Volume 40, Number 1, B, 1978, pages 106112.
Source Code:
Examples and Tests:
List of Routines:

AMINO_PRINT prints the amino acid parameters.

BINOMIAL_SAMPLE samples the Binomial PDF.

CH_CAP capitalizes a single character.

CH_EQI is a case insensitive comparison of two characters for equality.

CH_NEXT "reads" spaceseparated characters from a string, one at a time.

CH_TO_AMINO_NAME converts a character to an amino acid name.

CH_TO_DIGIT returns the value of a base 10 digit.

COMP_PARAM_PRINT prints the parameters for the mixture components.

DIRICHLET_MEAN returns the means of the Dirichlet PDF.

DIRICHLET_MIX_CHECK checks the parameters of a Dirichlet mixture PDF.

DIRICHLET_MULTINOMIAL_PDF evaluates a Dirichlet Multinomial PDF.

DIRICHLET_SAMPLE samples the Dirichlet PDF.

DISCRETE_CDF_INV inverts the Discrete CDF.

DISCRETE_SAMPLE samples the Discrete PDF.

EVENT_PROCESS updates the mixture weight distribution parameters.

EXPONENTIAL_01_CDF_INV inverts the Exponential 01 CDF.

EXPONENTIAL_01_SAMPLE samples the Exponential PDF with parameter 1.

EXPONENTIAL_CDF_INV inverts the Exponential CDF.

EXPONENTIAL_SAMPLE samples the Exponential PDF.

GAMMA_SAMPLE samples the Gamma PDF.

I4_NEXT "reads" integers from a string, one at a time.

MIXTURE_READ reads the Dirichlet mixture parameters from a file.

MULTINOMIAL_SAMPLE samples the Multinomial PDF.

NORMAL_01_SAMPLE samples the standard normal probability distribution.

R8_NEXT "reads" real numbers from a string, one at a time.

R8VEC_PRINT prints a real vector, with an optional title.

R8VEC_UNIT_SUM normalizes a real vector to have unit sum.

R8_GAMMA_LOG calculates the natural logarithm of GAMMA ( X ) for positive X.

R8_UNIFORM_01 returns a unit pseudorandom R8.

S_BEGIN is TRUE if one string matches the beginning of the other.

S_TO_I4 reads an I4 from a string.

S_TO_R8 reads an R8 value from a string.

TIMESTAMP prints the current YMDHMS date as a time stamp.
You can go up one level to
the FORTRAN90 source codes.
Last revised on 17 July 2013.