diff --git a/Anima/math-tools/statistical_distributions/animaDirichletDistribution.cxx b/Anima/math-tools/statistical_distributions/animaDirichletDistribution.cxx index bc79a6803..65e7496ff 100644 --- a/Anima/math-tools/statistical_distributions/animaDirichletDistribution.cxx +++ b/Anima/math-tools/statistical_distributions/animaDirichletDistribution.cxx @@ -1,6 +1,8 @@ #include "animaDirichletDistribution.h" #include + #include + #include namespace anima @@ -224,6 +226,7 @@ void DirichletDistribution::Fit(const MultipleValueType &sample, const std::stri } m_TotalConcentration = alphaSum; + m_MeanValues.resize(numParameters); for (unsigned int i = 0;i < numParameters;++i) m_MeanValues[i] = alphaParameters[i] / alphaSum;