Matrix Inverse/Divide: Difference between revisions

From NARS2000
Jump to navigationJump to search
(New page: <table border="1" cellpadding="5" cellspacing="0" rules="none" summary=""> <tr> <td> <table border="0" cellpadding="5" cellspacing="0" summary=""> <tr> <td><apll>Z←⌹R</...)
 
No edit summary
Line 4: Line 4:
     <table border="0" cellpadding="5" cellspacing="0" summary="">
     <table border="0" cellpadding="5" cellspacing="0" summary="">
     <tr>
     <tr>
       <td><apll>Z←⌹R</apll></td>
       <td valign="top"><apll>Z←⌹R</apll></td>
       <td></td>
       <td></td>
       <td></td>
       <td></td>
Line 13: Line 13:
</tr>
</tr>
<tr>
<tr>
   <td><apll>R</apll> is a numeric scalar, vector or matrix.  If <apll>R</apll> is a matrix, <apll>≥/⍴R</apll> must be true.</td>
   <td><apll>R</apll> is a numeric scalar, vector or matrix; otherwise signal a <apll>RANK ERROR</apll>.  If <apll>R</apll> is a matrix, <apll>≥/⍴R</apll> must be true; otherwise signal a <apll>LENGTH ERROR</apll>.</td>
</tr>
</tr>
<tr>
<tr>
Line 25: Line 25:


<apll>
<apll>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{domino}3 3{rho}0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;⌹3 3{rho}0<br />
&nbsp;0 0 0<br>
&nbsp;0 0 0<br />
&nbsp;0 0 0<br />
&nbsp;0 0 0<br />
&nbsp;0 0 0</apll><br />
&nbsp;0 0 0</apll><br />
<br />
<br />
<table border="1" cellpadding="5" cellspacing="0" rules="none" summary="">
<tr>
  <td>
    <table border="0" cellpadding="5" cellspacing="0" summary="">
    <tr>
      <td valign="top"><apll>Z←L⌹R</apll></td>
      <td></td>
      <td></td>
      <td>returns the quotient of the left and right arguments.  This quotient can be interpreted in various ways, such as the least squares solution of the system of linear equations determined by arguments.</td>
    </tr>
    </table>
  </td>
</tr>
<tr>
  <td><apll>L</apll> is a numeric scalar, vector or matrix; otherwise signal a <apll>RANK ERROR</apll>.</td>
</tr>
<tr>
  <td><apll>R</apll> is a numeric scalar, vector or matrix; otherwise signal a <apll>RANK ERROR</apll>.</td>
</tr>
<tr>
  <td>If either <apll>L</apll> or <apll>R</apll> is a scalar or vector, it is coerced to a matrix by <apll>(L R)←⍪{each}L R</apll>.  After this coercion, if the two matrices have a different number of rows, signal a <apll>LENGTH ERROR</apll>.</td>
</tr>
<tr>
  <td><apll>Z</apll> is a numeric array.  Before the above coercion of <apll>L</apll> and <apll>R</apll>, the rank of <apll>Z</apll> is <apll>¯2+2⌈(⍴⍴L)+⍴⍴R</apll>, and the shape is <apll>(1↓⍴R),1↓⍴L</apll>.</td>
</tr>
</table>
<br />
<p>This feature implements matrix division using [http://www.gnu.org/software/gsl/manual/html_node/Singular-Value-Decomposition.html Singular Value Decomposition].  In particular, this means that any two numeric arrays meeting the rank and shape requirements above are divisible.</p>
<p>For example,</p>
<apll>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a←3 3⍴0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a⌹a<br />
&nbsp;0 0 0<br />
&nbsp;0 0 0<br />
&nbsp;0 0 0</apll>

Revision as of 16:01, 7 May 2008

Z←⌹R returns the inverse of the right argument.
R is a numeric scalar, vector or matrix; otherwise signal a RANK ERROR. If R is a matrix, ≥/⍴R must be true; otherwise signal a LENGTH ERROR.
Z is a numeric array of rank ⍴⍴R, and shape ⌽⍴R.


This feature implements matrix inversion using Singular Value Decomposition. In particular, this means that any numeric array meeting the rank and shape requirements above is invertible.

For example,

      ⌹3 3⍴0
 0 0 0
 0 0 0
 0 0 0



Z←L⌹R returns the quotient of the left and right arguments. This quotient can be interpreted in various ways, such as the least squares solution of the system of linear equations determined by arguments.
L is a numeric scalar, vector or matrix; otherwise signal a RANK ERROR.
R is a numeric scalar, vector or matrix; otherwise signal a RANK ERROR.
If either L or R is a scalar or vector, it is coerced to a matrix by (L R)←⍪¨L R. After this coercion, if the two matrices have a different number of rows, signal a LENGTH ERROR.
Z is a numeric array. Before the above coercion of L and R, the rank of Z is ¯2+2⌈(⍴⍴L)+⍴⍴R, and the shape is (1↓⍴R),1↓⍴L.


This feature implements matrix division using Singular Value Decomposition. In particular, this means that any two numeric arrays meeting the rank and shape requirements above are divisible.

For example,

      a←3 3⍴0
      a⌹a
 0 0 0
 0 0 0
 0 0 0