Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Language Reference

SOLVE Function

solves a system of linear equations

SOLVE( A, B)

The inputs to the SOLVE function are as follows:
A
is an n ×n nonsingular matrix.

B
is an n ×p matrix.
The SOLVE function solves the set of linear equations AX = B for X. A must be square and nonsingular.

X = SOLVE(A,B) is equivalent to using the INV function as X = INV(A)*B. However, the SOLVE function is recommended over the INV function because it is more efficient and more accurate. An example follows:
   x=solve(a,b);
The solution method used is discussed in Forsythe, Malcolm, and Moler (1967).

The SOLVE function (as well as the DET and INV functions) uses the following criterion to decide whether the input matrix, A = [aij]i,j = 1, ... ,n, is singular:
{sing} = 100 x {MACHEPS} x 
 \max_{1 \leq i,j \leq n} | a_{ij}|
where MACHEPS is the relative machine precision.

All matrix elements less than or equal to sing are now considered rounding errors of the largest matrix elements, so they are taken to be zero. For example, if a diagonal or triangular coefficient matrix has a diagonal value less than or equal to sing, the matrix is considered singular by the DET, INV, and SOLVE functions.

Previously, a much smaller singularity criterion was used, which caused algebraic operations to be performed on values that were essentially floating point error. This occasionally yielded numerically unstable results. The new criterion is much more conservative, and it generates far fewer erroneous results. In some cases, you may need to scale the data to avoid singular matrices. If you think the new criterion is too strong,

Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Top
Top

Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.