Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #11823 > unrolled thread
| Started by | Clemens Fruhwirth <clemens@endorphin.org> |
|---|---|
| First post | 2012-09-20 04:26 +0000 |
| Last post | 2012-09-20 04:26 +0000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.soft-sys.math.mathematica
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: Linear combinations of Expectation of EmpiricalDistribution Clemens Fruhwirth <clemens@endorphin.org> - 2012-09-20 04:26 +0000
| From | Clemens Fruhwirth <clemens@endorphin.org> |
|---|---|
| Date | 2012-09-20 04:26 +0000 |
| Subject | Re: Linear combinations of Expectation of EmpiricalDistribution |
| Message-ID | <k3e5uf$it9$1@smc.vnet.net> |
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
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web