09-07-2006 05:58 PM
09-07-2006 08:49 PM
@bassbuckeye wrote:
Y = a*Signal1+b*Signal2 + c*Signal3....etc. I need to retrieve the coefficients a,b,c....
This should be trivial using the "general LS fit". Just compose the "H" matrix by making a 2D array of all your signals. The rest should fall into place. 🙂
Let me know if you get stuck. (I have a nice example but I am currently in traveling, so I don't have access)
09-07-2006 11:02 PM
Actually, the General Least Squares gives very poor fits. I have been very careful in constructing and checking the H matrix, yet the fit is still very poor. Even when fitting laboratory standards, which work exceptionally well in Mathcad, the fit fails to give values even close to the range that I would expect. I am not sure as to why, but I am thinking that Chi Square is not the ideal function to minimize in this case. I would like to be able to perform a fit by minimizing the sum of squares, but constructing the model string is not so simple for large models, and the time needed for the algorithm to converge is quite long, even with single variable models. I am baffled here as to why a normal least squares fit fails, as the same algorithm is used in several steps prior to this point in my data processing. If anyone has an idea or suggestion, I would greatly appreciate it.
Chris
09-07-2006 11:16 PM
@bassbuckeye wrote:
Actually, the General Least Squares gives very poor fits. I have been very careful in constructing and checking the H matrix, yet the fit is still very poor.
That really surprises me. What is your LabVIEW version? What algorithm do you you use (try e.g. Givens or instead of the default SVD). How many signals do you have? How many points in each signal? Are some of the signals very similar? Do they differ dramatically in amplitude? Would you mind posting a set of signals and a typical linear combination to be fit?
09-08-2006 09:39 AM
10-11-2006 06:29 PM
10-11-2006 07:25 PM
10-12-2006 11:43 AM
10-12-2006 01:50 PM - edited 10-12-2006 01:50 PM
I don't think there is an easy way using general LS fit, the algoritm mostly discussed in this thread. 🙂
Constraints are not directly supported by the LabVIEW tools but the answer is yes if you rewrite your model in terms of transformed parameters and use nonlinear least squares (Levenberg Marquardt)
If you cannot find the above quoted book, the following link shows some typcial cases:
http://v8doc.sas.com/sashtml/stat/chap19/sect41.htm
( I posted a similar link (now dead) very long ago: http://forums.ni.com/ni/board/message?board.id=170&message.id=152529#M152529) .
Message Edited by altenbach on 10-12-2006 11:55 AM
10-12-2006 02:43 PM