I would like to sample from a multinomial distribution. What's wrong in the following statements in sage 4.0.1?
>>> import numpy.random >>> numpy.random.multinomial(10, [.5,.5], size=20) Thank you -- Giovanni Traceback (click to the left for traceback) ... TypeError: unsupported operand parent(s) for '+': 'Integer Ring' and '<type 'tuple'>' Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/gmm/.sage/sage_notebook/worksheets/admin/41/code/ 265.py", line 7, in <module> numpy.random.multinomial(_sage_const_10 , [_sage_const_p5 ,_sage_const_p5 ], size=_sage_const_20 ) File "/home/gmm/sage-4.0.1/local/lib/python2.5/site-packages/ Jinja-1.2-py2.5-linux-x86_64.egg/", line 1, in <module> File "mtrand.pyx", line 2655, in mtrand.RandomState.multinomial File "element.pyx", line 729, in sage.structure.element.ModuleElement.__add__ (sage/structure/element.c: 6528) File "coerce.pyx", line 740, in sage.structure.coerce.CoercionModel_cache_maps.bin_op (sage/structure/ coerce.c:6584) TypeError: unsupported operand parent(s) for '+': 'Integer Ring' and '<type 'tuple'>' --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---