Ejemplo n.º 1
0
f.method = NelderMead()
resn = f.fit()
print("Change in statistic: {}".format(resn.dstatval))

fit2 = Fit(d, mdl, method=NelderMead())
fit2.fit()

mdl.c1.thaw()
f.method = original_method

res2 = f.fit()
report("res2.format()")

from sherpa.plot import DelchiPlot, FitPlot, SplitPlot
fplot = FitPlot()
rplot = DelchiPlot()
splot = SplitPlot()
mplot.prepare(f.data, f.model)
fplot.prepare(dplot, mplot)
splot.addplot(fplot)
rplot.prepare(f.data, f.model, f.stat)
splot.addplot(rplot)

savefig("fit_delchi_c0_c1_c2.png")

# what does JointPlot do?
from sherpa.plot import JointPlot
jplot = JointPlot()
jplot.plottop(fplot)
jplot.plotbot(rplot)
savefig("fit_delchi_c0_c1_c2_jointplot.png")
Ejemplo n.º 2
0
 def __init__(self):
     DelchiPlot.__init__(self)
Ejemplo n.º 3
0
plateau.c0 = np.max(d.y)
mplot.prepare(d, mdl)
dplot.plot()
mplot.overplot()
savefig("model_data_reset.png")

fitres3 = f.fit()
report("fitres3.format()")

mplot.prepare(d, mdl)
dplot.plot()
mplot.overplot()
savefig("model_data_fit2.png")

from sherpa.plot import DelchiPlot
residplot = DelchiPlot()
residplot.prepare(d, mdl, f.stat)
residplot.plot()
savefig("model_data_delchi.png")

d.notice()
dump("d.get_filter(format='%d')")

from sherpa.plot import FitPlot
fitplot = FitPlot()
dplot.prepare(d)
mplot.prepare(d, mdl)
fitplot.prepare(dplot, mplot)
fitplot.plot()
savefig("model_data_fit_all.png")