Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>According to the 1D example, we are given a sequence of values <code>(xi, yi)</code>, where the <code>xi</code> values are vectors of dimension <code>n</code> (<code>n = 1</code> or <code>n = 2</code>), and the <code>yi</code> values are scalars. We wish to find mean <code>mu</code> and covariance matrix <code>sigma</code> for a Gaussian function <code>f</code> of dimension <code>n</code> such that the <code>f(xi)</code> values are close to the <code>yi</code> values.</p> <p>To solve this problem we have to define what <em>close</em> means. We can choose for example to minimize the sum of the squares <code>(yi - f(xi))^2</code>. The resulting non-linear optimization problem in <code>mu</code> and <code>sigma</code> can be solved with an iterative method such as <a href="http://en.wikipedia.org/wiki/Levenberg%E2%80%93Marquardt_algorithm" rel="nofollow">Levenberg–Marquardt</a>.</p> <hr> <p>If MatLab is used perhaps see their <a href="http://www.mathworks.se/support/tech-notes/1500/1508.html" rel="nofollow">Curve Fitting Guide</a>, specifically the <a href="http://www.mathworks.se/support/tech-notes/1500/1508.html#section2bb" rel="nofollow">Nonlinear Curve Fitting</a> section and the <code>lsqnonlin</code> and <code>lsqcurvefit</code> examples. If Python is used, you can find library bindings to Levenberg–Marquardt implementations in C/C++ or Fortran.</p> <p>Whatever approach is used, I recommend trying out the solver on the 1D example first.</p> <p>Another relevant resource is <a href="http://www.scipy.org/Cookbook/FittingData" rel="nofollow">SciPy's data fitting cookbook</a>, which includes a section on <a href="http://www.scipy.org/Cookbook/FittingData#head-11870c917b101bb0d4b34900a0da1b7deb613bf7" rel="nofollow">fitting a 2D gaussian</a>.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload