Closed Kevinpgalligan closed 5 months ago
Don't need special syntax for assigning random variables, e.g. binom
can be a function that returns a random variable and X
is just a variable.
X = binom(n, p)
Note: >
comparison operator would clash with current unit conversion operator.
Brainstorming:
sample
function that takes a random variable and returns a set. Also takes a set.mean
function takes a random variable or set. E
function is expectation, only takes random variables.This is preeeetty much done, just have to add support for adding scalars to / multiply constants by RVs. I would like to support unions of events / joint probability / whatever, as well as adding random variables together, but that gets messy when RVs are dependent on each other. And should be easy enough to manually compute with the existing tools.
Actually, I don't see an immediate use for scalar arithmetic with RVs. Instead of E(X+1)
you can just do E(X)+1
, for example. So... passing on that for now.
This would basically be a pretty shim over scipy. It would require a RandomVariable type, an Event type, probability function
P
that accepts Events, expected value functionE
that accepts random variables, and so on.