Re: [Pymc-user] poisson for negative values
Status: Beta
Brought to you by:
fonnesbeck
From: Christopher F. <ch...@tr...> - 2006-05-17 03:00:33
|
On May 15, 2006, at 7:20 PM, Seth de l'Isle wrote: > Hello, > > I was expecting a poisson prior to limit a parameter to possitive > values > much like using the exponential prior would. Instead it halted > processing. > >>>> from PyMC.MCMC import * >>>> class foo(MetropolisHastings): pass > ... >>>> f = foo() >>>> f.exponential_prior(-1, 5) > nan >>>> f.poisson_prior(-1, 5) > PAUSE negative factorial in factln statement executed > To resume execution, type go. Other input will terminate the job. > > STOP > > Shouldn't poisson_prior and poisson_like return nan as well? Hi Seth, Thats a good point. At the moment, the likelihoods only enforce the parameters of the distribution, and not the data. I essentially leave it up to the user not to pass negative data values. Part of the reason for this is to avoid as much checking as possible (i.e. "if" statements), as this slows down the model. C. -- Christopher J. Fonnesbeck, Ph.D. Population Ecologist, Marine Mammal Section Fish & Wildlife Research Institute (FWC) St. Petersburg, FL Adjunct Assistant Professor Warnell School of Forestry and Natural Resources University of Georgia Athens, GA T: 727.235.5570 E: chris at trichech.us |