Comment #16 on issue 3090 by nathan.f...@gmail.com: Create ContinuousDensity class
http://code.google.com/p/sympy/issues/detail?id=3090

Hmm... I see.

Maybe you can convert a dict to a Piecewise?
{1: 1/2, 0: 1/2} -> Piecewise((1/2, Eq(x, 1)), (1/2, Eq(x, 0)), (0, True)).
But that is very cumbersome. I'm stuck on a good basis to make different kinds of representations for continuous and finite rvs: a lambda-like representation for continuous, and a dictionary-like representation for finite. Ideas so far:

-ProbabilityFunction subclasses Lambda, but MassFunction (for finite) overrides it with a dict-like printing -ProbabilityFunction doesn't subclass Lambda and has abstract functions for checking normality. There are implemented in the subclasses DensityFunction, which also subclasses Lambda, and MassFunction, which subclasses dict (or has dict-like properties and representation). -Add a Dict object to sympy to represent a finite mapping of symbols (which I think can have other applications). MassFunction will subclass this new type of object.

Extensions:
-Infinite discrete rv's (Countable) would use Lambdas, with the extra specification that inputs must be integers. -Multivariate rv's would be multivariate Lambda functions: /\((x, y), x**2+y**2).

--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To post to this group, send email to sympy-issues@googlegroups.com.
To unsubscribe from this group, send email to 
sympy-issues+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sympy-issues?hl=en.

Reply via email to