[Scipy-tickets] [SciPy] #1502: lognorm pdf produces incorrect values

SciPy Trac scipy-tickets@scipy....
Thu Aug 25 15:13:14 CDT 2011


#1502: lognorm pdf produces incorrect values
--------------------------+-------------------------------------------------
  Reporter:  rgrout       |       Owner:  somebody    
      Type:  defect       |      Status:  closed      
  Priority:  high         |   Milestone:  Unscheduled 
 Component:  scipy.stats  |     Version:  0.9.0       
Resolution:  worksforme   |    Keywords:  lognorm, pdf
--------------------------+-------------------------------------------------
Changes (by rkern):

  * status:  new => closed
  * resolution:  => worksforme


Comment:

 No, it's correctly calculated, it just follows a different convention than
 you may be used to. For a uniform interface to all of the distributions,
 they all take a location and scale parameter. In this case, exp(m) is the
 scale parameter. Take a look at the docstring for scipy.stats.lognorm.
 Thus, you don't specify the mean directly, you specify scale=exp(m) in the
 arguments to the various methods. ._pdf() is an internal method that
 computes the PDF for loc=0, scale=1.0. The .pdf() method will normalize
 its input by the location and scale parameter, call the ._pdf() method
 with the normalized input, then do the appropriate adjustment for the
 scale.

 http://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.lognorm.html#scipy.stats.lognorm
 http://docs.scipy.org/doc/scipy/reference/tutorial/stats/continuous.html
 #continuous-random-variables

 If you still think there is a bug, please reopen this ticket and show us
 exactly what example you tried, the results that you obtained from scipy,
 as well as the corresponding examples and results from the other software
 that you are comparing against. Thanks!

-- 
Ticket URL: <http://projects.scipy.org/scipy/ticket/1502#comment:1>
SciPy <http://www.scipy.org>
SciPy is open-source software for mathematics, science, and engineering.


More information about the Scipy-tickets mailing list