示例#1
0
文件: sitedoc.py 项目: RONNCC/bumps
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()
示例#2
0
文件: sitedoc.py 项目: HMP1/bumps
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()
示例#3
0
文件: sitedoc.py 项目: RONNCC/bumps
def plot_model(filename):
    numpy.random.seed(SEED)
    p = load_problem([os.path.join(example_dir(), filename)])
    p.plot()
    pylab.show()
示例#4
0
文件: sitedoc.py 项目: HMP1/bumps
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()