MultinomialDistribution Argument cannot be negative. Parameter name: n

4 views
Skip to first unread message

Matthias Maschek

unread,
Mar 9, 2017, 12:29:22 AM3/9/17
to Accord.NET Framework
Hello!

I ran into maybe a bug, I am starting out with the example for MultinomialDistribution.

But when i call Generate on it, it throws  an argument exception with  Argument cannot be negative. Parameter name: n.
But N is 5 in the example.

Is this a bug or am i doing something wrong?


int numberOfTrials = 5;
double[] probabilities = { 0.25, 0.75 };
// Create a new Multinomial distribution with 5 trials for 2 symbols
var dist = new MultinomialDistribution (numberOfTrials, probabilities);
try
{
var test = dist.Generate();
} catch(ArgumentException es)
{

//HERE We have an Argument cannot be negative. Parameter name: n
}


Thanks
Reply all
Reply to author
Forward
0 new messages