11-10-2014 01:11 PM
I have a data set with a non-diagonal covariance matrix [s2]. The chi-square is then (y-yfit)^T[s2]^{-1}(y-yfit), where [s2]^{-1} is the weighting matrix--the inverse of the covariance matrix--and (y-yfit) is a column vector of fit residuals and (y-yfit)^T is the corresponding row vector. As far as I know, solving for the parameters of yfit that minimize this chi-square should be pretty straightforward for this case. One just has to allow for a weighting matrix instaed of a vector of weights and then properly use this matrix in the Levingberg-Marquardt algorithm. Has anyone done a fit of this kind and have any suggestions?
11-11-2014 03:36 PM
Hi,
I am not clear on what is the final LabVIEW question here. Are you wondering if this is possible in LabVIEW or are you hoping that someone has done it and maybe would like to share the code?
11-11-2014 04:04 PM
Hi Miro,
I am hoping someone has done it already and would be willing to share the code. I am working on the needed changes myself already, but the first try at it today came up short. The "sum of three gaussians" example vi is my test case and it didn't do the fit correctly. I will probably have to look at intermediate vectors and matrices in the two versions to see where I screwed up.
Regards,
Bob
11-12-2014 12:29 PM
Hi
In this case i would recommend to do more searching in NI community forums. You should be able to find people who deal more closely with this type of computation.
For example:
https://forums.ni.com/t5/LabVIEW/Levenberg-Marquardt-doesn-t-do-a-good-job-fitting/td-p/2130450
Good Luck!