Analytical solution to fitting two functions

37 Views Asked by At

I have two oscillatory functions $f(x)$ and $(k x)^2 g(x)$ where $f$ and $g$ are known and it is also known that the two functions are approximately similar. How can I analytically find the best estimate of $k$, $\hat{k}$ in the least square (or any norm $p$) sense? I can do it numerically by discretizing it and running it through any of the several solvers/algorithms, but is it possible to do this analytically?

1

There are 1 best solutions below

4
On

This is one solution I adopted for similar problems in order to avoid discretization and curve fit $$k^2=\frac{\int_a^b x^2 g(x) \, dx}{\int_a^b f(x) \, dx}$$ I even wonder if this does not correspond exactly to the least square fit solution for an infinite number of data points for $a<x<b$.