@property<EOL><INDENT>def d_distributionparams(self):<DEDENT>
if not self._d_distributionparams:<EOL><INDENT>dx = <NUM_LIT><EOL>def f_alpha(alpha):<EOL><INDENT>return DiscreteGamma(alpha, self.beta_lambda, self.ncats)<EOL><DEDENT>def f_beta(beta):<EOL><INDENT>return DiscreteGamma(self.alpha_lambda, beta, self.ncats)<EOL><DEDENT>assert set(self.distributionparams) == {'<STR_LIT>', '<STR_LIT>'}<EOL>for (param, f) in [('<STR_LIT>', f_alpha), ('<STR_LIT>', f_beta)]:<EOL><INDENT>pvalue = getattr(self, param)<EOL>dparam = scipy.misc.derivative(f, pvalue, dx, n=<NUM_LIT:1>, order=<NUM_LIT:5>)<EOL>assert dparam.shape == (self.ncats,)<EOL>for stepchange in [<NUM_LIT:0.5>, <NUM_LIT:2>]: <EOL><INDENT>dparam2 = scipy.misc.derivative(f, pvalue, stepchange * dx,<EOL>n=<NUM_LIT:1>, order=<NUM_LIT:5>)<EOL>assert scipy.allclose(dparam, dparam2, atol=<NUM_LIT>, rtol=<NUM_LIT>), (<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>").format(param, pvalue,<EOL>dx, dx * stepchange, dparam, dparam2)<EOL><DEDENT>self._d_distributionparams[param] = dparam<EOL><DEDENT><DEDENT>return self._d_distributionparams<EOL>
See docs for `DistributionModel` abstract base class.