Y fit error for weighted levenberg marquart algorithm
3 views (last 30 days)
I am using the weighted levenberg marquard algorith, and I want to calculate the error for each fitted x value. I have a vector of x data, a vector of y data, and a vector of standard deviation of the y data. Each vector has n points. For each data point there were several measurements (at the same value of x), so I calculated the stdev of these y values (at each x value). The wights are 1/ stdev_ymeasured^2.
After performing the fit, how can I calculate the error (or the uncertainty of the fit) for each input value of x. The fit is obviously a smooth line, but the uncertainty should vary along it, both because the weights are not equal and because the residuals at each point are different.
I tried using eqn. 19 from this page: http://people.duke.edu/~hpgavin/ce281/lm.pdf but the dimentions of W are wrong; I assume W is a 1*n matrix, with each entry wi being the weight for each x value. Also, I am total unclear as to what sigma_y^2 is supposed to be. Is there a better/different way to calculate the uncertainty? If this formula is appropriate, what is the matrix W actually supposed to be?