GeneralDiscreteDistribution.Generate(Int32): Possible Bug?

15 views
Skip to first unread message

ald...@gmail.com

unread,
Sep 6, 2015, 4:59:52 PM9/6/15
to Accord.NET Framework
Hi,

I'm trying to sample multiple observations from a GeneralDiscreteDistribution as following, but always get 0 as the elements of output array:

...
double[] transProbRow = emoStateTransMatrix.GetRow(currentEmoState);
GeneralDiscreteDistribution gdd = new GeneralDiscreteDistribution(transProbRow);
int[] emoParticles = gdd.Generate(100); // This gives me an all zero vector
...

But if I sample in the following way everything works fine

...
double[] transProbRow = emoStateTransMatrix.GetRow(currentEmoState);
GeneralDiscreteDistribution gdd = new GeneralDiscreteDistribution(transProbRow);
int[] emoParticles = new int[100];
for(int i=0; i<100; i++)
emoParticles[i] = gdd.Generate();
...

Am I using the Generate function wrong in the first case or is this a some kind of bug?

César

unread,
Sep 7, 2015, 6:49:54 AM9/7/15
to Accord.NET Framework
Hi there,

Thanks for reporting the issue; this definitely seems like a bug. Could you please report it in the projet's issue tracker at https://github.com/accord-net/framework/issues ?

If it is indeed a bug, I will fix it as soon as possible.

Best regards,
Cesar
Reply all
Reply to author
Forward
0 new messages