[SciPy-User] fit to discrete distr?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[SciPy-User] fit to discrete distr?

Neal Becker
http://docs.scipy.org/doc/scipy/reference/tutorial/stats.html
says 'no fit' method is available on discrete distr, while:

http://docs.scipy.org/doc/scipy/reference/tutorial/stats/discrete.html
has a section on 'fitting data'.

Can I use scipy to fit my data to a discrete distr (nbinom, in this case)?

_______________________________________________
SciPy-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/scipy-user
Reply | Threaded
Open this post in threaded view
|

Re: fit to discrete distr?

Robert Kern-2
Construct a function that computes the negative log-likelihood:

  def f(params, dist=dist, data=data):
      return -dist.logpmf(data, *params).sum()

Use optimize.minimize() on that with appropriate configuration.

On Wed, Jul 15, 2015 at 2:34 PM, Neal Becker <[hidden email]> wrote:
http://docs.scipy.org/doc/scipy/reference/tutorial/stats.html
says 'no fit' method is available on discrete distr, while:

http://docs.scipy.org/doc/scipy/reference/tutorial/stats/discrete.html
has a section on 'fitting data'.

Can I use scipy to fit my data to a discrete distr (nbinom, in this case)?

_______________________________________________
SciPy-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/scipy-user



--
Robert Kern

_______________________________________________
SciPy-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/scipy-user