[SciPy-User] Rician distributions lacks sigma parameter

josef.pktd@gmai... josef.pktd@gmai...
Wed Apr 4 12:53:24 CDT 2012

On Wed, Apr 4, 2012 at 1:33 PM, Morten Kjeldgaard <mok@bioxray.dk> wrote:
> 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:

the shape parameter nu has to be strictly positive, eg. nu=1e-10 works
there is a problem with the calculation for nu equal to zero


> 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
> _______________________________________________
> SciPy-User mailing list
> SciPy-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user

More information about the SciPy-User mailing list