ot-mixmod: a new OT-module to create a Mixture Factory composed of Normal Distributions

Hi, I have written a small OpenTURNS module to create a Mixture Factory composed of Normal Distributions from a Numerical Sample. The sources of the module are available in the openturns-module repository. However, you can download here the version 0.1.0.

This module uses MixMod with the default parameters. This module requires version 0.13.2 of OpenTURNS and MixMod executable.

Here an example of a python script to use this module:

from openturns import * from otmixmod import * draw = True dim = 2 size = 2000 coll = DistributionCollection(0) R = CorrelationMatrix(dim) for i in range(dim-1):

R[i,i+1] = 0.1

coll.add(Distribution(Normal(NumericalPoint(dim, -2.0), NumericalPoint(dim, 1.2), R))) for i in range(dim-1):

R[i,i+1] = -0.2

coll.add(Distribution(Normal(NumericalPoint(dim, 2.0), NumericalPoint(dim, 0.8), R))) mean = NumericalPoint(dim, 5.0) mean[0] = -5.0 coll.add(Distribution(Normal(mean, NumericalPoint(dim, 1.4), CorrelationMatrix(dim)))) mixture = Mixture(coll) sample = mixture.getNumericalSample(size) factory = MixtureFactory(3) estimatedDistribution = factory.buildImplementation(sample) print "Estimated distribution=", estimatedDistribution if draw:

g = estimatedDistribution.drawPDF() c = Cloud(sample) c.setColor("red") c.setPointStyle("bullet") ctmp = g.getDrawable(0) g.setDrawable(Drawable(c), 0) g.addDrawable(ctmp) g.draw("testMixMod")


No comments.