02-06-2012 05:18 PM
Hi all,
I have a overdetermined system of linear equations that I solve using lsqlin in Matlab. I've found that genlineqs in the advanced analysis library can give me similar answers when using lsqlin with no constraints. However, I need to postively constrain the solutions which I can't seem to do in cvi at all. Does anyone have any insights, whether with genlineqs or any other libraries out there that might allow me to do this?
Many thanks in advance
02-07-2012 05:26 PM
Hello there,
I am unaware of any positive (or non-negative) constraint Best answer approximation for this type of problem in CVI, I know of a document that explains an algorithm that implements one of these algorithms.
(http://mathematicsandcomputation.freezoka.net/MC07/Math07/pdfs/mcsna01299full.pdf This is used for Spectrometry but the algorithm should work well for any situation)
In the mean time I will continue to see what I can find in the API.
Daniel
02-07-2012 05:35 PM
Thanks Daniel. I kind of figured I wouldn't be able to do it in cvi. Seems like there should be some package out there though that works in c for these kinds of problems.
02-08-2012 08:04 AM
I have tested the algorithm in th paper that was previously mentioned and it gives you a LSR answer with constraints that everything is non-negative. I think that is going to be your best shot. Thank you for your help.
02-08-2012 11:58 AM
Thanks, I started looking at the paper yesterday and it seems like just what I need. I'm going to start working on implementing it in cvi.
02-08-2012 12:16 PM
If you are going to consider non-linear least square algorithms with constraints it might be of interest that Intels MKL library provides suitable routines, and that a free routine in C is also available here. In the first case linking may pose a difficulty, in the second that the code is quite 'universal', i.e. a little bit bloated, but it is actively maintained.