The validity of Least Squares Fitting to a specific problem

96 Views Asked by At

I'm going to try and keep this question broad, so I apologise if it's poorly written.

I have a series of functions;

$$ \Psi_{j} = \sum_{n = 1}^{N} A_{n} \sinh{2 \pi n S_{j}} \cos{2 \pi n X_{j}} + A_{N + 1}S_{j} $$

In which $S_{j}$'s and $X_{j}$'s are known, and initial estimates of the $A_{n}$'s are provided. However, these $A_{n}$ values, when correct, should result in each $\Psi_{j}$ = 1.

My question is, is a non-linear least squares fitting method (in particular the Levenberg-Marquadt method) the correct way to go about correcting these $A_{n}$ values, such that the correct $\Psi$ results can be obtained.

My methodology to date (which seems incorrect) is to calculate the merit function as follows;

$$\chi^{2} = \sum_{j=0}^{N-1} [ \frac{\Psi_{j} - 1}{\sigma_{j}} ]^{2} $$

Where 1 is the target value for $\Psi$.

The problem itself is relating to stream-function theory. Again, I apologise if the question is too broad/specific to be of any use.

1

There are 1 best solutions below

4
On BEST ANSWER

You really have a matrix multiplication here. If we define a matrix $B$, with $B_{nj}= \sinh{2 \pi n S_{j}} \cos{2 \pi n X_{j}},B_{N+1,j}=S$ as a matrix equation you have $\Psi=AB$. If $B$ is square, you can invert it. If not, you are over or under constrained. In the overconstrained case, you can do least squares directly by solving the normal equations. Minimizing the sum of the squared errors works, too, but can lead to inaccuracy because you are squaring the errors and they can get very small.

Although the $B_{nj}$ are nonlinear functions of $n,j, \Psi_j$ depends linearly on the $A_i$. This makes it a linear least squares problem in the overconstrained case. Levenberg-Marquadt is usually used in non-linear cases, but it will work in linear cases as well.