[Scipy-tickets] [SciPy] #251: The variance returned by stats.beta.stats is buggy.

SciPy scipy-tickets at scipy.net
Fri Aug 18 13:45:18 CDT 2006


#251: The variance returned by stats.beta.stats is buggy.
--------------------+-------------------------------------------------------
 Reporter:  dhuard  |       Owner:  somebody
     Type:  defect  |      Status:  new     
 Priority:  normal  |   Milestone:          
Component:  Other   |     Version:          
 Severity:  normal  |    Keywords:          
--------------------+-------------------------------------------------------
 {{{
 >>> stats.beta.stats(3,4)
 (array(0.42857142857142855), array(1.9591836734693877))

 >>> stats.beta.rvs(3,4,size=10000).var()
 0.030624072104638293
 }}}
 And the exact answer is 3/98 = 0.030612244897959183

 mean = alpha/(alpha+beta)

 variance = alpha*beta/(alpha+beta)**2/(alpha+beta+1)

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


More information about the Scipy-tickets mailing list