public void FitTest2()
{
double[][] observations =
{
new double[] { 1, 2 },
new double[] { 1, 2 },
new double[] { 1, 2 },
new double[] { 1, 2 }
};
var target = new MultivariateNormalDistribution(2);
bool thrown = false;
try { target.Fit(observations); }
catch (NonPositiveDefiniteMatrixException) { thrown = true; }
Assert.IsTrue(thrown);
NormalOptions options = new NormalOptions() { Regularization = double.Epsilon };
// No exception thrown
target.Fit(observations, options);
}