def maxlike(self,nseeds=<NUM_LIT:50>):
mA_0,age0,feh0 = self.ic.random_points(nseeds)<EOL>mB_0,foo1,foo2 = self.ic.random_points(nseeds)<EOL>mA_fixed = np.maximum(mA_0,mB_0)<EOL>mB_fixed = np.minimum(mA_0,mB_0)<EOL>mA_0, mB_0 = (mA_fixed, mB_fixed)<EOL>d0 = <NUM_LIT:10>**(rand.uniform(<NUM_LIT:0>,np.log10(self.max_distance),size=nseeds))<EOL>AV0 = rand.uniform(<NUM_LIT:0>,self.maxAV,size=nseeds)<EOL>costs = np.zeros(nseeds)<EOL>if self.fit_for_distance:<EOL><INDENT>pfits = np.zeros((nseeds,<NUM_LIT:6>))<EOL><DEDENT>else:<EOL><INDENT>pfits = np.zeros((nseeds,<NUM_LIT:4>))<EOL><DEDENT>def fn(p): <EOL><INDENT>return -<NUM_LIT:1>*self.lnpost(p)<EOL><DEDENT>for i,mA,mB,age,feh,d,AV in zip(range(nseeds),<EOL>mA_0,mB_0,age0,feh0,d0,AV0):<EOL><INDENT>if self.fit_for_distance:<EOL><INDENT>pfit = scipy.optimize.fmin(fn,[mA,mB,age,feh,d,AV],disp=False)<EOL><DEDENT>else:<EOL><INDENT>pfit = scipy.optimize.fmin(fn,[mA,mB,age,feh],disp=False)<EOL><DEDENT>pfits[i,:] = pfit<EOL>costs[i] = self.lnpost(pfit)<EOL><DEDENT>return pfits[np.argmax(costs),:]<EOL>
Returns the best-fit parameters, choosing the best of multiple starting guesses

        :param nseeds: (optional)
            Number of starting guesses, uniformly distributed throughout
            allowed ranges.  Default=50.

        :return:
            list of best-fit parameters: ``[mA,mB,age,feh,[distance,A_V]]``.
            Note that distance and A_V values will be meaningless unless
            magnitudes are present in ``self.properties``.