## examples/fitting/doc_example_conf1.lar
# create mock data
mdat = group()
mdat.x = linspace(-10, 10, 201)
mdat.y = 1.0 + gaussian(mdat.x, 12.0, 1.5, 2.0) + \
         random.normal(size=len(mdat.x), scale=0.050)


params = param_group(off = guess(0),
                     amp = guess(5, min=0),
                     cen = guess(2),
                     wid = guess(1, min=0))


# define objective function for fit residual
def myresid(p, data):
    return data.y - (p.off + gaussian(data.x, p.amp, p.cen, p.wid))
#enddef

# perform fit

result = minimize(myresid, params, args=(mdat,))

# print report of parameters, uncertainties
print( fit_report(result))

out = confidence_intervals(result, sigmas=(1, 2, 3))

print( confidence_report(out))
## end of examples/fitting/doc_example_conf1.lar
