A simple fix would certainly by pass the check in random.choice, but I
don't know how to get that. So let's focus on the summation.
I believe you are hitting an instability in summing small numbers as a
power to 10th order would produce. Here is an example:
mymatrix =
On Fri, Dec 18, 2015 at 1:25 PM, Ryan R. Rosario wrote:
> Hi,
>
> I have a matrix whose entries I must raise to a certain power and then
> normalize by row. After I do that, when I pass some rows to
> numpy.random.choice, I get a ValueError: probabilities do not sum to 1.
>
Hi,
I have a matrix whose entries I must raise to a certain power and then
normalize by row. After I do that, when I pass some rows to
numpy.random.choice, I get a ValueError: probabilities do not sum to 1.
I understand that floating point is not perfect, and my matrix is so large that
I