0

Calling

rayleigh_args = stats.rayleigh.fit(num_list)

Returns a tuple of 2 values e.g. (-320.34, 360.77). Where I can use it to get the CDF or PDF of the distribution for a given value.

I can't find what each of those values represents. In addition, as far as I'm aware the rayleigh distribution requires only one scale parameter σ in order to calculate CDF and PDF.

My question is, what is the meaning of the scipy.stats return values, and how can I get the actual σ of the distribution. So I can use it in another application.

George T
  • 44
  • 4
  • Hmm, something to look at: try `print(stats.rayleigh.__doc__)` and `print(stats.rayleigh.fit.__doc__)`. – Robert Dodier Jun 24 '22 at 22:52
  • I have read the documentation its no help, also the PDF function in the docs looks incomplete. I'm not a statistician so I might be missing something, but it doesn't have the scaling factor on it. – George T Jun 25 '22 at 10:19
  • https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.rayleigh.html mentions location and scale parameters. – Robert Dodier Jun 25 '22 at 15:16
  • Typically, fit returns location and scale. Scale being sigma, or proportional to sigma. – Severin Pappadeux Jun 28 '22 at 16:41

1 Answers1

0

Let's assume you have an array of data called num_list, then you only need to get the average of the data array (or mu). After that, you can calculate the Sigma parameter of the Rayleigh distribution as follows:

Sigma= mu*math.sqrt(2/math.pi)
allexiusw
  • 1,533
  • 2
  • 16
  • 23