输出错误是:MinimizerException:在没有合理的不确定性估计的情况下无法确定置信区间
为什么我得到这个错误?如何计算不确定性估计并解决这个问题?
for dosya1 in glob.glob("mean*"):
data1=np.genfromtxt(dosya1, skip_header=0, skip_footer=0, names=["wavelength","mean"])
x=data1["wavelength"]
mod=VoigtModel()
pars = mod.guess(y, x=x)
pars['gamma'].set(value=0.7, vary=True, expr="")
out=mod.fit(y,pars, x=x)
pars=lmfit.Parameters()
pars.add_many(('amp', out.params["amplitude"].value), ('sig', out.params["sigma"].value), ("gam",out.params["gamma"].value),("cent",out.params["center"].value))
def residual(p):
amp=p["amp"].value
sig=p["sig"].value
gam=p["gam"].value
cent=p["cent"].value
return ((wofz((x-cent + wofz(gam).imag)/(sig*(sqrt(2)))).real) / (sig*(sqrt(2))))- y
mini = lmfit.Minimizer(residual, pars)
result=mini.minimize()
ci = lmfit.conf_interval(mini, result)
lmfit.printfuncs.report_ci(ci)