5

I want to generate a continuous distribution (type Maxwell-Boltzmann) with Python. I mean, I want to create the distribution in order to generate random values.

This link kinda helps:

Create a continuous distribution in python

I don't have idea where to start, I know the analytical function that generates the distribution but I don't know how to implement that. Can anyone help me?

Thanks in advance

Community
  • 1
  • 1
dapias
  • 2,512
  • 3
  • 15
  • 23
  • 1
    SciPy is your best friend http://www.johndcook.com/distributions_scipy.html – darmat Aug 26 '13 at 04:18
  • scipy has a Maxwell-Boltzmann distribution built-in http://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.maxwell.html Have you seen this, and does it do what you want? – tom10 Aug 26 '13 at 04:26
  • Thanks for answering, I didn't know the built-in function. Thanks a lot, that's what I need @tom10. – dapias Aug 26 '13 at 05:02
  • OK, I'll write this as an answer, so people will know that this question is answered and can comment, vote, edit, etc. – tom10 Aug 26 '13 at 15:17

1 Answers1

6

scipy has a Maxwell-Boltzmann distribution built-in, maxwell, and its pdf method will give you the probability density function.

tom10
  • 67,082
  • 10
  • 127
  • 137