Problem creating new random variable class

OK, that helps. Here are two follow up questions, if you would be so kind:

  1. My logp method uses slots on the distribution object I’m creating (for the MillerDist, parameters/slots, P,Q,R, and S. But as far as I can tell, since those are put into the object by my __init__ method, the resulting FreeRV instance cannot see them. This seems like almost a FAQ – when we add properties to a custom random variable, where do we put them and find them? My colleague suggests using, for example, var.distribution.P – is that right?

  2. My MillerDist class has a plot method defined on it. Should I be turning this into a static method and then just invoking it as MillerDist.plot(var) instead of as var.plot()? Or should I be using var.distribution.plot()?

  3. (sorry, one more --) I defined MillerDistribution.logp(). Seems like I need to reference it as var.distribution.logp, correct?

Maybe it would be helpful to add some description of the protocol for adding a new kind of random variable… I’m willing to help with editing this page, if that’s the right place.

Thanks, as always!