OK, that helps. Here are two follow up questions, if you would be so kind:
-
My
logpmethod uses slots on the distribution object I’m creating (for theMillerDist, parameters/slots,P,Q,R, andS. But as far as I can tell, since those are put into the object by my__init__method, the resultingFreeRVinstance 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? -
My
MillerDistclass has aplotmethod defined on it. Should I be turning this into a static method and then just invoking it asMillerDist.plot(var)instead of asvar.plot()? Or should I be usingvar.distribution.plot()? -
(sorry, one more --) I defined
MillerDistribution.logp(). Seems like I need to reference it asvar.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!