public void FitTest5()
{
double[][] observations =
{
new double[] { 1, 2 },
new double[] { 1, 2 },
new double[] { 0, 1 },
new double[] { 5, 7 }
};
double[] weights = { 1, 1, 0, 0 };
var target = new MultivariateNormalDistribution(2);
bool thrown = false;
try { target.Fit(observations, weights); }
catch (NonPositiveDefiniteMatrixException) { thrown = true; }
Assert.IsTrue(thrown);
NormalOptions options = new NormalOptions() { Robust = true };
// No exception thrown
target.Fit(observations, weights, options);
checkDegenerate(target);
}