title: Gaussian Curve Fitting - Parameter Estimation - Android/Java
body: <p>I have to fit a Gaussian curve to a noisy set of data and then take it's FWHM for a certain application. I used MATLAB to demo the concept, and curve fitting in MATLAB is extremely easy.</p>
  
  <p>However, I eventually have to translate the code into Java/Android. I tried looking for libraries in Android that would help me fit a Gaussian curve to data set, but I couldn't find anything. Consequently, I started trying to learn all the math involved so I could do it manually.</p>
  
  <p>My question: How do I go about estimating the three parameters (center, width, height) for a single-term gaussian model? I tried looking into the Expectation-Maximization algorithm but that went way over my head.</p>
  
  <p>In general, I assume it would have something to do with error minimization? I'm just having trouble figuring out the step-by-step method of fitting a gaussian curve to my data.</p>
  
  <p>EDIT:</p>
  
  <p>One of the things I tried already involved taking the natural log of my data, fitting a parabola to the result using LSQR, and then transforming back. However, the results I'm getting aren't accurate, probably because this method is biased in some way or another.</p>
  
  <p>If you don't know how to do parameter estimation, do you have any other suggestions of fitting a curve to my data? (Remember, it has to be manual since Android seems to be fairly limited on it's statistics libraries)</p>