Borrar filtros
Borrar filtros

How to reproduce MATLAB's normal distribution random numbers?

17 visualizaciones (últimos 30 días)
Vitaly Krepak
Vitaly Krepak el 24 de Mzo. de 2015
Respondida: Andrew Newell el 24 de Mzo. de 2015
I'm porting a project from MATLAB to Python and it turns out that while uniform distribution random generator are identical in NumPy and MATLAB, the numbers for normal distribution are slightly different. After some googling I've found out that the reason is different algorithms of transformation from uniform to normal distribution. MATLAB uses Ziggurat algorithm by default and NumPy uses Box-Muller if I'm not mistaken.
Our MATLAB project uses Phased Array Toolbox, so there's no way to insert our own generator into it.
Is there any way to reproduce MATLAB's normal distribution random generator in Python or C/C++?

Respuestas (1)

Andrew Newell
Andrew Newell el 24 de Mzo. de 2015
I did a quick search, and found Patch with Ziggurat method for Normal distribution (Trac #1450) #2047. But if you need help with this, you should probably contact a Python usergroup.

Categorías

Más información sobre Call Python from MATLAB en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by