Need to express curves as a set of gaussians, and compare two of these sets

291 Views Asked by At

I have two xy curves, defined numerically on a given (potentially different) range of x coordinates. What I need to do is to compare these two curves with the following strategy:

  1. express each curve as a sum of unknown gaussian functions, to be determined.
  2. compare the two sets of gaussians.
  3. obtain a similarity score ranging from 0% (absolutely no similarity) to 100 % (they are the same).

I am not looking for exceedingly fancy algorithms for these tasks, but any hint and keywords to search for will certainly be welcome.

1

There are 1 best solutions below

0
On BEST ANSWER
  1. Fix the number of Gaussians $n$ you consider. Then, perform an OLS estimation of the difference between the sum of the $n$ Gaussians and your observations: $$ \min_{\alpha, \mu,\sigma}\;\sum_j\sum_{i=1}^n (\alpha_i\cdot\phi_{\mu_i,\sigma_i}(x_j)-y_j)^2. $$
  2. Use a nonlinear optimization algorithm for this, e.g., the scipy package in Python. This gets you two sets of $(\alpha, \mu, \sigma)$, which you can compare.
  3. For comparison, take again the sum of squared differences of the parameters, appropriately weighted, and apply $\exp(-\cdot)$ to map this into $(0, 1]$. However, other similarity mappings might be more appropriate for your application -- you might want to experiment here a bit.

EDIT: There is a whole theory about nonlinear least squares, which might work better than simply trying to optimize the objective function shown above.