def maxlike(self,nseeds=50):
        """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: ``[m,age,feh,[distance,A_V]]``.
            Note that distance and A_V values will be meaningless unless
            magnitudes are present in ``self.properties``.
        
        """
        m0,age0,feh0 = self.ic.random_points(nseeds)
        d0 = 10**(rand.uniform(0,np.log10(self.max_distance),size=nseeds))
        AV0 = rand.uniform(0,self.maxAV,size=nseeds)

        

        costs = np.zeros(nseeds)

        if self.fit_for_distance:
            pfits = np.zeros((nseeds,5))
        else:
            pfits = np.zeros((nseeds,3))
            
        def fn(p): #fmin is a function *minimizer*
            return -1*self.lnpost(p)
        
        for i,m,age,feh,d,AV in zip(range(nseeds),
                                    m0,age0,feh0,d0,AV0):
                if self.fit_for_distance:
                    pfit = scipy.optimize.fmin(fn,[m,age,feh,d,AV],disp=False)
                else:
                    pfit = scipy.optimize.fmin(fn,[m,age,feh],disp=False)
                pfits[i,:] = pfit
                costs[i] = self.lnpost(pfit)

        return pfits[np.argmax(costs),:]
def maxlike ( self , nseeds = 50 ) : m0 , age0 , feh0 = self . ic . random_points ( nseeds ) d0 = 10 ** ( rand . uniform ( 0 , np . log10 ( self . max_distance ) , size = nseeds ) ) AV0 = rand . uniform ( 0 , self . maxAV , size = nseeds ) costs = np . zeros ( nseeds ) if self . fit_for_distance : pfits = np . zeros ( ( nseeds , 5 ) ) else : pfits = np . zeros ( ( nseeds , 3 ) ) def fn ( p ) : return - 1 * self . lnpost ( p ) for i , m , age , feh , d , AV in zip ( range ( nseeds ) , m0 , age0 , feh0 , d0 , AV0 ) : if self . fit_for_distance : pfit = scipy . optimize . fmin ( fn , [ m , age , feh , d , AV ] , disp = False ) else : pfit = scipy . optimize . fmin ( fn , [ m , age , feh ] , disp = False ) pfits [ i , : ] = pfit costs [ i ] = self . lnpost ( pfit ) return pfits [ np . argmax ( costs ) , : ]
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: ``[m,age,feh,[distance,A_V]]``.
            Note that distance and A_V values will be meaningless unless
            magnitudes are present in ``self.properties``.