#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: |
------------------------+---------------------------------------------------
I'm not sure if anyone really maintains the file
sage/local/lib/python2.6/site-packages/sage/probability/random_variable.py
but there's a definite problem with the way expectation is defined.
{{{
sage: X=frequency_distribution([1,1,1,2,2,2])
sage: X.expectation()
0.500000000000000
}}}
Instead of weighting values by probabilities the function sums the squares
of the probabilities involved. It should be an easy fix, I"ll try to put a
patch up soon, if you're used to submitting patches and bored, you'll
probably get to it before me.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10770>
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.