[SciPy-User] log pdf, cdf, etc

josef.pktd at gmail.com josef.pktd at gmail.com
Sat May 29 14:20:19 EDT 2010


On Sat, May 29, 2010 at 1:21 PM, Skipper Seabold <jsseabold at gmail.com> wrote:
> On Sat, May 29, 2010 at 12:49 PM,  <josef.pktd at gmail.com> wrote:
>> a naming question
>> _lnpdf or _logpdf ? _lncdf or _logcdf ?
>>
>
> My vote would be for log over ln since np.log(np.e) == 1.

Yes, I don't know what I was thinking early in the morning, nobody
seems to use ln anymore

I edited the script
rename ln ->log
make print optional
add generic method
replace hasattr by  (not sure this is the best way)

def isnotgeneric(distfn, methodname):
    sub = getattr(distfn, methodname)
    gen = getattr(stats.distributions.rv_continuous, methodname)
    return not sub.im_func is gen.im_func

(generic methods don't pass the tests for all distributions, there are
some problems with broadcasting in the current _pdf, _cdf
implementations for some distributions)

Josef

>
> Skipper
> _______________________________________________
> SciPy-User mailing list
> SciPy-User at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>



More information about the SciPy-User mailing list