def solve(self, monitors=None, mapper=None, **options): _fill_defaults(options, self.settings) from quasinewton import quasinewton, STATUS self._update = MonitorRunner(problem=self.problem, monitors=monitors) result = quasinewton(fn=self.problem.nllf, x0=self.problem.getp(), monitor=self._monitor, itnlimit=options['steps'], ) code = result['status'] print "%d: %s" % (code, STATUS[code]) return result['x'], result['fx']
def fmin(f,x0,fprime): try: return quasinewton(fn=f,x0=x0,grad=fprime)['x'] except: return x0
def fmin(f, x0, fprime): try: return quasinewton(fn=f, x0=x0, grad=fprime, itnlimit=100)['x'] except: #raise return x0
def fmin(f, x0, fprime): try: return quasinewton(fn=f, x0=x0, grad=fprime, itnlimit=100)["x"] except: # raise return x0