#10770: Expectation of probability spaces is defined improperly
------------------------+---------------------------------------------------
   Reporter:  weigandt  |       Owner:  weigandt                
       Type:  defect    |      Status:  new                     
   Priority:  minor     |   Milestone:  sage-4.7                
  Component:  misc      |    Keywords:  Probability, Expectation
     Author:            |    Upstream:  N/A                     
   Reviewer:            |      Merged:                          
Work_issues:            |  
------------------------+---------------------------------------------------

Comment(by jason):

 Maybe this is what you intended?

 {{{
 sage: P=frequency_distribution([1,1,1,2,2,2])
 sage: P
 Discrete probability space defined by {1: 0.500000000000000, 2:
 0.500000000000000}
 sage: X=DiscreteRandomVariable(P, {1:1, 2:2})
 sage: X
 Discrete random variable defined by {1: 1, 2: 2}
 sage: X.expectation()
 1.50000000000000
 }}}

 Maybe the confusion is that DiscreteProbabilitySpace inherits from
 DiscreteRandomVariable (and so inherits the expectation method from
 DiscreteRandomVariable)?  Again, I'm not a statistician, so I'm not sure
 what's natural.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10770#comment:2>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to