[SciPy-User] Build a new continuous probability density function

josef.pktd@gmai... josef.pktd@gmai...
Sun Jun 16 16:04:41 CDT 2013


On Sun, Jun 16, 2013 at 4:51 PM, MRE Simulator
<mresimulator@yahoo.com.ar> wrote:
> Hi experts!
> Im a newby user of Python, sage and Scipy.
> Using scipy.stats module, i'm trying to build a new probability density
> function, f(x) (not include in scipy module). I wanna call this function in
> similar way that other probability density function in scipy, i.e.:
> from scipy.stats import new_function.
> And do some math with it:
> new_function.mean(loc=....., scale= -----), etc.
> ¿What must i do (step by step, including definition of scale and loc)?
> Waiting for your answers.

a bit of explanation
https://github.com/scipy/scipy/blob/master/scipy/stats/distributions.py#L944

you can look at any distribution as example, like
https://github.com/scipy/scipy/blob/master/scipy/stats/distributions.py#L3581

most things are handled generically, the more ._xxx methods you can
specify the better is the performance because you don't have to rely
on the generic, often slow implementation.
loc and scale are handled completely generically and cannot be
overwritten by the ._xxx methods.

The only tricky part might be if you have bound support or need to
override shape parameter restrictions.

If you have specific questions, I can answer those.
Best if you describe more details of the distribution or show pdf and
cdf and parameter restrictions.

Josef

> Thanks a lot!
>
> _______________________________________________
> SciPy-User mailing list
> SciPy-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>


More information about the SciPy-User mailing list