How to find fitting parameters of the function?

121 Views Asked by At

I have the function describing the experimental data - $f(x)$. I also have another function - $g(x, \bar{p})$, which is the theoretical function for the process involved. Here $\bar{p}$ - is the vector of additional unknown parameters of model description. I need to find vector $\bar{p}$, which is the best fitting parameters for $f(x)$ function.

I have tried the following solution. Lets introduce distance function of $f$ and $g$:

$$M(f, g) = M(\bar{p}) = \sqrt{\int_{0}^{1} (f(x) - g(x, \bar{p}))^2 dx}$$

Here interval $[0,1]$ is the interested. And by minimizing the $M(\bar{p})$ I get what I want - vector $\bar{p}$. Disadvantage of this method is that it finds only one solution, probably not the best one. I use Rsolnp package to search the minimum, which implements General Non-linear Optimization Using Augmented Lagrange Multiplier Method.

It works well, it finds the resulting vector.

Is there any other methods or algorithms for this task? What advantages they offer?