Moments
The linearity rule table behind expect and variance.
This is the part that belongs in a computer algebra system rather than in a statistics library: E[aX + b] = a·E[X] + b is a rewrite, applied to the expression's structure before any number is computed, so it works while a and b are still free variables.
Structured exactly like scalar.Derive: a rule table, most specific first, with a give-up fallback. The give-up is None, which the calling node turns into "stay symbolic" — the termination guard every _Functional in this codebase shares.
What is deliberately not here. E[XY] = E[X]·E[Y] requires the factors to be independent, and nothing in the language expresses independence between two random variables. Asserting it would produce confidently wrong answers for correlated ones, so a product of two distinct random variables stays symbolic. A product where only one factor is random is fine, and is the a·X rule below.
Attributes
- See also
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Moments.type