How error in coefficients are calculated in non-linear curve fitting?
Sat, 04/25/2020 - 12:28 am
After a curve fitting process we get optimised values of coefficients as follows-
coefficients = value +- SD
My question is how this SD for coeficients are calculated?
Let us consider I'm fitting my data having n number of points with a model containing c no of coefficients. The wave contaning initial guess of coefficients named as coef (say). Say the iteration stops after 35.
I have assumed the following two cases-
Case 1. A matrix M contains all the coefficients used for each iterations as columns (say), i.e., after each iteration a new column gets added to the matrix M. Thus the dimension of M will be c x 35. Now, SD are calculated for each row M(i,:) and the results are presented as K_i = mean_i +- SD_i where K_i is the i-th coefficient in the coef wave.
Case 2. A matrix M contains all the coefficients used for each data points as columns (say). Thus the dimension of M will be c x n. After each iteration the values in the matrix M are replaced. Now, SD are calculated for each row M(i,:) and the results are presented as K_i = mean_i +- SD_i where K_i is the i-th coefficient in the coef wave.
Now if the case 1 is true then bag guess also contributes to the optimised coefficient values (in SD). I believe this is not the case. Also, in certain cases no of iteration might be very low and then SD would be meaningless.
But if the case 2 is true, then both the above situations will not arise as at the final iteration we will have a distribution of coefficients most suitable for each data points and hence, their SD is also meaningful. Currently, I'm considering the case 2 as true.
Please, clarify whether I'm thinking in right direction or not.
N.B. According to L-M algorithm, I know a small shift vector is added to the initial guess vector after each iteration (may or may not be for each data points) to lower the ssq. So, the above said matrix M can also keep track of that shift vector, right. But for simplicity, I assumed M contains coefficient values.
Thanks in advance,