# forum.alglib.net

ALGLIB forum
 It is currently Sat Jul 02, 2022 11:47 am

 All times are UTC

### Forum rules

1. This forum can be used for discussion of both ALGLIB-related and general numerical analysis questions
2. This forum is English-only - postings in other languages will be removed.

 Page 1 of 1 [ 1 post ]
 Print view Previous topic | Next topic
Author Message
 Post subject: rmatrixsolvels gives different answer for the same problem?Posted: Thu Jan 31, 2013 10:36 pm

Joined: Thu Jan 31, 2013 10:21 pm
Posts: 1
Hi all,

I'm a newbiew to this forum. I encountered a problem when using the function rmatrixsolvels to solve a overdetermined A*x = b problem.

The purpose is solving two unknowns, u1 and u2. The equation is as this format
G = u1 * P / (P + u2).
G and P are both observed from real experiments.
The equation above can be transformed into two different formats as below.
Format 1
P * u1 - p * u2 = G * P
Format 2
p * 1 / u1 + u2 / u1 = P / G.
In Format 2, I set 1 / u1 as x1, and u2 / u1 as x2, so for A*x = b, the equation is like
G * x1 + x2 = P/G
Clearly,
A[i, 0] = Gi, A[i, 1] = 1;
b[i] = Pi/Gi, i = 1,2,..,m data points
Then I used rmatrixsolvels to solve the problem and got the exact answers I want.

However, if I follow Format 1,
A[i, 0] = Pi, A[i, 1] = -Gi;
b[i] = Gi * Pi,
Then I used rmatrixsolvels and got totally different answers!

I'm wondering when we use rmatrixsolvels, should one column in matrix A be always 1? Is that why my Format 2 failed? Per my poor knowledge on least-square method, the equation is x0 + x1*t1 + x2* t2 .... = y. Does that mean the coefficient for x0, is 1 by default?
It may be more like a math rather than coding quesiton. Any comments appreciated!

Top

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 1 [ 1 post ]

 All times are UTC

#### Who is online

Users browsing this forum: No registered users and 3 guests

 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum

Search for: