Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.math.mathematica

Topic: Linear combinations of Expectation of EmpiricalDistribution
Replies: 1   Last Post: Sep 20, 2012 12:26 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View  
Clemens Fruhwirth

Posts: 3
Registered: 9/18/12
Re: Linear combinations of Expectation of EmpiricalDistribution
Posted: Sep 20, 2012 12:26 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On 18 September 2012 00:33, Clemens Fruhwirth <clemens@endorphin.org> wrote:

> * Am I missing an assumption here or some syntax? Or is this rule just
> not built into Mathematica?


For the archives:

Mathematica 8.0.4.0 has the following rule for
Statistics`ExpectationDump`iExpectation:

Statistics`ExpectationDump`iExpectation[Statistics`ExpectationDump`e_,
Statistics`ExpectationDump`f__] /;
Quiet[Internal`LiteralPresentQ[{Statistics`ExpectationDump`e,
Statistics`ExpectationDump`f}, DataDistribution] && !
FreeQ[{Statistics`ExpectationDump`e,
Statistics`ExpectationDump`f},
Statistics`ExpectationDump`g_DataDistribution /;
With[{Statistics`ExpectationDump`dom =
Statistics`Library`DataDistributionDomain[
Statistics`ExpectationDump`g]},
Head[Statistics`ExpectationDump`dom] === List &&
FreeQ[Statistics`ExpectationDump`dom, Interval]]]] := $Failed

To me, it reads as if it's a cut -- in the prolog sense of the word --
for the case where the domain of the DataDistribution is not an
interval. I am not sure what to make of that rule, as I don't see the
point of the cut for this special case. Maybe the second FreeQ is
supposed to be !FreeQ?

If I remove this rules from the rule set, all my examples work just fine..

{Expectation[x + y, dist],
Mean[TransformedDistribution[x + y, dist]],
Variance[TransformedDistribution[x + y, dist]]}
/. dist ->
{x \[Distributed] EmpiricalDistribution[{0, 1, 2}],
y \[Distributed] EmpiricalDistribution[{0, 10, 20}]}

{11, 11, 202/3}

I'll file a bug.
--
Fruhwirth Clemens http://clemens.endorphin.org




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2013. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.