我不知道現成的一步式解決方案。對於兩步混合和匹配的方式,你可以熟悉Boost.Math這對於在統計分佈部分單變量正常distrubtion的:
// [...] many headers and namespaces inclusions
int main()
{
// Construct a standard normal distribution s
normal s; // (default mean = zero, and standard deviation = unity)
cout << "Standard normal distribution, mean = "<< s.mean()
<< ", standard deviation = " << s.standard_deviation() << endl;
/*` First the probability distribution function (pdf).
*/
cout << "Probability distribution function values" << endl;
cout << " z " " pdf " << endl;
cout.precision(5);
for (double z = -range; z < range + step; z += step)
{
cout << left << setprecision(3) << setw(6) << z << " "
<< setprecision(precision) << setw(12) << pdf(s, z) << endl;
}
cout.precision(6); // default
// [...] much more
}
然後,您可以使用本徵辦必要的向量和矩陣操作來傳遞標量。這blog posting有更多的細節(儘管它使用Boost.Random來生成樣本值)。