title: How do I get minuit.Minuit to fit a gaussian curve to my data in Python?
body: <p>I am trying to fit a gaussian to some simple data using the minuit.Minuit function but it doesnt change any of my parameters. If anyone can help out I would be very grateful.</p>
  
  <pre><code>import numpy as np
  import minuit
  
  xCurve = np.array([0,1,2,3,4,5,6,7,8,9])
  yCurve = np.array([0,1,2,3,4,5,4,3,2,1])
  
  
  def Gaus(a,b,c):
      return a*np.exp(-((xCurve-b)**2)/(2*c**2))
  
  m = minuit.Minuit(Gaus,a=4.5,b=5,c=0.4)
  m.printMode=1
  m.migrad()
  m.printMode=0
  m.values()
  
  a = m.values['a']
  b = m.values['b']
  c = m.values['c']
  d = m.values['d']
  print a
  print b
  print c
  print d
  </code></pre>
  
  <p>it spits out an error:
  minuit.MinuitError: Covariance is not positive definite.</p>