<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 If you don't care about the confidence interval of parameter
Step1:  If you want the confidence intervals
<ASSISTANT_TASK:>
Python Code:
from lmfit.models import GaussianModel
# initialize the gaussian model
gm = GaussianModel()
# take a look at the parameter names
print gm.param_names
# I get RuntimeError since my numpy version is a little old
# guess parameters
par_guess = gm.guess(n,x=xpos)
# fit data
result = gm.fit(n, par_guess, x=xpos, method='leastsq')
# quick look at result
print result.fit_report()
# get best fit error and stderr
print result.params['amplitude'].value,result.params['amplitude'].stderr
print result.params['center'].value,result.params['center'].stderr
print result.params['sigma'].value,result.params['sigma'].stderr
fig = plt.figure()
plt.hist(xdata, bins=bins)
plt.plot(xpos, result.best_fit, 'green')
Explanation: If you don't care about the confidence interval of parameter
End of explanation
import lmfit
def my_gaussian_model(p, x, y):
    a = np.float(p['a'])
    b = np.float(p['b'])
    c = np.float(p['c'])
    return a/np.sqrt(2.*c) * np.exp( -np.power(x-b,2.)/2./np.power(c, 2.)) - y
pars = lmfit.Parameters()
pars.add_many(('a',0.1), ('b',0.1), ('c',0.1))
# initialize the minimizer
mini = lmfit.Minimizer(my_gaussian_model, pars, (xpos, n))
# do the minimization
result = mini.minimize(method='leastsq')
# print the fit report
print lmfit.fit_report(mini.params)
# NOTE
# the parameter 'a' in function my_gaussian_model is different from the built-in model in lmfit
# so the amplitude value is a little different
# predit the confidence interval of all parameters
ci, trace = lmfit.conf_interval(mini, sigmas=[0.68,0.95],
                                trace=True, verbose=False)
# ci = lmfit.conf_interval(mini)
lmfit.printfuncs.report_ci(ci)
print ci.values()
a,b,prob = trace['a']['a'], trace['a']['b'], trace['a']['prob']
cx, cy, grid = lmfit.conf_interval2d(mini,  'a','b',30,30)
plt.contourf(cx, cy, grid, np.linspace(0,1,11))
plt.xlabel('a')
plt.colorbar()
plt.ylabel('b')
Explanation: If you want the confidence intervals
End of explanation
<END_TASK>