Comment #9 on issue 3129 by [email protected]: Drastic change to sympy.stats: Adding concept of Probability Distributions on surface level
http://code.google.com/p/sympy/issues/detail?id=3129

Both T and T_posterior have a link to their internal symbol.

In [6]: T.symbol is Symbol('T')
Out[6]: True

In [7]: T.symbol is T_posterior.symbol
Out[7]: True

Really a RandomSymbol is just a PSpace/symbol pair. I.e. "RandomSymbol 'T_posterior' points to the symbol 'T' within the conditional probability space with density exp((T-30)...."

The user sees the interior variable whenever they print out T_posterior. They're thinking about the concept "T" or temperature, that's what T_posterior represents, and that's what gets printed out.

You could think of a RandomSymbol as being a pair of a symbolic variable and a known value. Lets consider this in a simpler deterministic (non-random) setting. We link the concept temperature to the known value 30C ("temp", 30C). Even though we know the value we still want to play with this as a symbolic entity, not just the number 30. As a result we'll use they symbol "temp" most of the time. When we're done with symbolic manipulations, we decide we want to compute the value of some expression like temp**2. Ok, now we're ready to plug in the value 30. This switch from "temp" to 30 happens in each of the functions E, P, Density, Sample, etc....

RandomSymbols do exactly this except that the value isn't just a number, it's more complex. At first it's more complex because we want to link a symbol to some probabilistic set of outcomes, a distribution. In full generality these outcomes can depend on lots of things though, not just this particular concept of the temperature. After intertwining a number of random variables and conditions things can get a bit hairy. The internal symbols gave structure to these decisions and, after you've thought about it a long while, seem to make sense.

This system is probably needlessly complex in many ways. I like the distribution idea and I really like the idea of someone else taking a fresh look at all this. There are a few things I suspect you'll run into though. The above example is one of them.

I'll have a fair amount of time this week and next to be helpful where I can.


--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" 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/sympy-issues?hl=en.

Reply via email to