SOLVE Ax=u

Reply
Occasional Contributor
Posts: 8

SOLVE Ax=u

Dear all,

I want to solve Ax=b for A. i.e. x and b are known vectors A is unknown matrix. Please can anybody let me know how to find the matrix A by proc iml..

Thank you in advanced.

Respected Advisor
Posts: 2,655

Re: SOLVE Ax=u

Try posting this in the IML Forum, as can give you a direct reference to the documentation or his blog where this has been discussed.

Steve Denham

SAS Super FREQ
Posts: 3,489

Re: SOLVE Ax=u

Did you mis-state the problem? Usually A and b are known and you need to find x.

As you've stated it, the problem has infinitely many solutions when x is not identically zero.

Since x is not all zeros, there is some element x_i which is nonzero. Construct the matrix A that is zero everywhere except for the i_th column, where it has the value b/x_i.

For example:

proc iml;
x = T(4:0);
b = T(1:3);


i=1;  /* for this problem x[1] is nonzero */

A = j(nrow(b), nrow(x), 0);
A[,i] = b/x;

diff = A*x-b; /* compute A*x - b */
print diff;

Ask a Question
Discussion stats
  • 2 replies
  • 170 views
  • 0 likes
  • 3 in conversation