[SciPy-User] Rician distributions lacks sigma parameter

Morten Kjeldgaard mok@bioxray...
Wed Apr 4 12:33:13 CDT 2012


Thanks for replies Josef and Warren!

I think my current limitation is that I don't fully grasp how the  
shape and scale parameters are propagated to the individual stats  
distributions, and alas the autogenerated documentation isn't always  
very helpful.

> Given the parameters nu and sigma (as shown in the wikipedia  
> article), you use scipy.stats.rice by setting the scale=sigma and  
> the shape parameter b=nu/sigma.  You can use the following script to  
> verify this:

Like you write, the script works fine with parameters (nu, sigma) =  
(3.45, 0.35), but it actually fails when I try to reproduce the plots  
in the wikipedia article. When setting (nu, sigma) = (0, 1), I get the  
following:

AssertionError:
Not equal to tolerance rtol=1e-07, atol=0

x and y nan location mismatch:
  x: array([  0.00000000e+00,   3.99680128e-02,   7.97444092e-02,
          1.19139103e-01,   1.57965051e-01,   1.96039735e-01,
          2.33186584e-01,   2.69236346e-01,   3.04028363e-01,...
  y: array([ nan,  nan,  nan,  nan,  nan,  nan,  nan,  nan,  nan,   
nan,  nan,
         nan,  nan,  nan,  nan,  nan,  nan,  nan,  nan,  nan,  nan,   
nan,
         nan,  nan,  nan,  nan,  nan,  nan,  nan,  nan,  nan,  nan,   
nan,...

In other words, your defined function rice_pdf works, but stats.rice  
does not.

Cheers,
Morten



More information about the SciPy-User mailing list