@inherit_docstring_from(rv_discrete_meco)<EOL><INDENT>def fit_mle(self, data, init_vals=(<NUM_LIT>, <NUM_LIT>)):<DEDENT>
if len(data) > <NUM_LIT:1>:<EOL><INDENT>mu = np.mean(data)<EOL>var = np.var(data)<EOL>theta0 = var / mu<EOL>alpha0 = mu / theta0<EOL><DEDENT>else:<EOL><INDENT>alpha0 = init_vals[<NUM_LIT:0>]<EOL>theta0 = init_vals[<NUM_LIT:1>]<EOL><DEDENT>def mle(params):<EOL><INDENT>return -np.sum(np.log(self.pmf(data, params[<NUM_LIT:0>], params[<NUM_LIT:1>])))<EOL><DEDENT>alpha, theta = optim.fmin(mle, x0=[alpha0, theta0], disp=<NUM_LIT:0>)<EOL>return alpha, theta<EOL>
%(super)s
        In addition to data, can take init_vals which allows the user to
        specify initial values for (alpha, theta) during the optimization.