Hi folks,
I have a straightforward, but tedious probability problem that I need to expand symbolically. Sympy's set and interval material is close, but I can't see how it would work in a multidimensional application. I've used Sympy for some fairly intricate PDE problems, but never for this sort of thing, and I would appreciate any suggestions, please.
I have a number of events that appear as, for example 2 < X < 5 and 3 < Y < 8 which have associated probabilities and joint distributions (i.e. are not mutually exclusive). From basic probability and set theory
p( 2<X<5 \cup 3<Y<8) = p( 2<X<5 ) + p( 3<Y<8 ) - p( 2<X<5 \cap 3<Y<8 )
and so on. My problems start with about 6 unions that are intersections fo 2 conditions each, all in 3 variables, so requires both the expansion above and reduction for intersecting intervals. It isn't difficult, just tedious (and error-prone).
I was about to hand-roll the symbolic algebra as Python classes, but I was wondering if there was a way to approach this with Sympy's intervals module. It's not clear to me, from the docs or from experimentation, that it handles multi-dimensional problems.
Best regards
-- Simon
--
You received this message because you are subscribed to the Google Groups "sympy" group.
To view this discussion on the web visit https://groups.google.com/d/msg/sympy/-/qd4-NeUkPzIJ.
To post to this group, send email to sy...@googlegroups.com.
To unsubscribe from this group, send email to sympy+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/sympy?hl=en.
I'm not strictly convinced that that will work for all complex cases. You should double-check your first results.
I've just been looking through the core/set.py and stats/*.py code (and brushing up with the Measure Theory chapters from Friedman's Foundations of Modern Analysis; it's been a while). I didn't twig to the * operator creating multi-dimensional intervals. Naming the axes would be nice but that's just a bookkeeping convenience.
Unit measure isn't a biggie for me. Joint probabilities will almost certainly have to be estimated as if the two variables were independent. For my measurements, which are generated from a statistical fit, the model should (ideally, if not actually in theory) give me at least uncorrelated axes and I have an empirical distribution for the random variables that should at least let me scale everything to marginal values. As a first approximation it's probably good enough.
On Monday, 12 November 2012 12:53:43 UTC-5, Matthew wrote:I'm not strictly convinced that that will work for all complex cases. You should double-check your first results.
Will do. I'll post my final notes and code.
--
You received this message because you are subscribed to the Google Groups "sympy" group.
To view this discussion on the web visit https://groups.google.com/d/msg/sympy/-/X8YHtVh_nJcJ.
--
You received this message because you are subscribed to the Google Groups "sympy" group.
To view this discussion on the web visit https://groups.google.com/d/msg/sympy/-/Dalk6tMLV3gJ.
There are two different systems in sympy to represent facts; these are our two assumptions systems.
...
This has been one of the top issues in SymPy for a long while. If we had some mechanism to associate bounties to issues this would probably have the highest.
--
You received this message because you are subscribed to the Google Groups "sympy" group.
To view this discussion on the web visit https://groups.google.com/d/msg/sympy/-/Bk4yrPFD4pEJ.