def fit_model(filename): numpy.random.seed(SEED) p =load_problem([os.path.join(example_dir(),filename)]) #x.fx = RLFit(p).solve(steps=1000, burn=99) x,fx = DEFit(p).solve(steps=200, pop=10) #x,fx = PTFit(p).solve(steps=100,burn=400) #x.fx = BFGSFit(p).solve(steps=200) chisq = p(x) print "chisq=",chisq if chisq>2: raise RuntimeError("Fit did not converge") p.plot() pylab.show()
def fit_model(filename): #import sys; print >>sys.stderr, "in plot with",filename, example_dir() numpy.random.seed(SEED) p =load_problem([os.path.join(example_dir(),filename)]) #x.fx = RLFit(p).solve(steps=1000, burn=99) x,fx = DEFit(p).solve(steps=200, pop=10) #x,fx = PTFit(p).solve(steps=100,burn=400) #x.fx = BFGSFit(p).solve(steps=200) chisq = p(x) print("chisq=%g"%chisq) if chisq>2: raise RuntimeError("Fit did not converge") p.plot() pylab.show()
def plot_model(filename): numpy.random.seed(SEED) p = load_problem([os.path.join(example_dir(), filename)]) p.plot() pylab.show()
def plot_model(filename): #import sys; print >>sys.stderr, "in plot with",filename, example_dir() numpy.random.seed(SEED) p = load_problem([os.path.join(example_dir(), filename)]) p.plot() pylab.show()