forum.alglib.net
http://forum.alglib.net/

Non-negative Least Square Problem using lsfitlinearc()
http://forum.alglib.net/viewtopic.php?f=2&t=491
Page 1 of 1

Author:  bitinf [ Fri Nov 25, 2011 4:13 pm ]
Post subject:  Non-negative Least Square Problem using lsfitlinearc()

Hi, everyone! I'm new to Alglib.
I'm trying to solve a non-negative linear least square problem:

The aim is to solve:
A*X = B. (A is an n*n matrix, B is a vector with n elements, X stores the solutions).
subject to (1) 0<= X(i) <= 1 (2) Sum X(i) = 1; ( X(i) is the i-th element in X).


I'm trying to use the function lsfitlinearc(real_1d_array y,real_2d_array fmatrix, real_2d_array cmatrix,ae_int_t& info,real_1d_array& c,lsfitreport& rep);
But I have some questions about it.
(1) Could anyone tell me the correspondance between fmatrix and my matrix A? I mean, the required input fmatrix and my matrix A in A*X=B. Because I don't quite understand the examples given on the webpage about the function.
(2) In lsfitlinearc(), there's no constraint about boundaries. So can I use lsfitsetbc() to set the boundaires before I call lsfitlinearc()? I tried adding lsfitsetbc() in the example code for lsfitlinearc(), but the results didn't change with boundary constraints. I guess the two functions are independent of each other. Right?

Thanks a lot for your answers!!

Author:  hugolove [ Tue Apr 03, 2012 9:11 pm ]
Post subject:  Re: Non-negative Least Square Problem using lsfitlinearc()

Hello, have you managed to resolve this issue? I am also trying to run lsfitsetbc for least square calculation on a matrix and I am having similar problem. It would be great if you could post a working code. hugo

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/