Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

## vxl-users

 [Vxl-users] Questions about Least Square!! From: - 2006-08-31 02:40:56 ```Hi! I got a problem in getting resolution of a set of equations(Ax=b). Becoz A has the dimension 3000*20, i think Least Square algorithm can be employed, that is, I should seek A to minimize Sum_i(a_i*x-b_i)^2 in which a_i is the ith row of A and i is from 1 to 3000. I found that vnl_levenberg_marquardt is a approach for Least Square and it needs a initial value. But every time I ran the code, it seemed that it didn't iterate to minimize the cost function, so i got the output that equals initial value. could anybody tell me what's wrong? And i want to know if there is any other algorithms available in vxl for Least Square. I also found vnl_lsqr, but by the document it can be used only when A is a sparse matrix. Am i wrong? Any hint will be appreciated!! Regards, Roger ```
 [Vxl-users] Questions about Least Square!! From: - 2006-08-31 02:42:04 ```Hi! I got a problem in getting resolution of a set of equations(Ax=b). Becoz A has the dimension 3000*20, i think Least Square algorithm can be employed, that is, I should seek A to minimize Sum_i(a_i*x-b_i)^2 in which a_i is the ith row of A and i is from 1 to 3000. I found that vnl_levenberg_marquardt is a approach for Least Square and it needs a initial value. But every time I ran the code, it seemed that it didn't iterate to minimize the cost function, so i got the output that equals initial value. could anybody tell me what's wrong? And i want to know if there is any other algorithms available in vxl for Least Square. I also found vnl_lsqr, but by the document it can be used only when A is a sparse matrix. Am i wrong? Any hint will be appreciated!! Regards, Roger ```
 Re: [Vxl-users] Questions about Least Square!! From: Lianqing Yu - 2006-08-31 07:11:49 ```TWFueSBwb3NzaWJsZSByZWFzb25zIG1pZ2h0IGxlYWQgdG8geW91ciBpc3N1ZSBzbyBpdCdzIGRp ZmZpY3VsdCBmb3IgdXMgdG8gbG9jYXRlIHRoZSBleGFjdCBzb3VyY2Ugb2YgZXJyb3IuDQoNCkZv ciB0aGUgbGVhc3Qtc3F1YXJlIHByb2JsZW0sIHRoZSBnZW5lcmFsIGd1aWRlbGluZSBpcyB0byBj b21wdXRlIGFuIGluaXRpYWwgZXN0aW1hdGUgd2l0aCBhIG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