documentation
authorBen Pfaff <blp@cs.stanford.edu>
Sat, 9 Oct 2021 23:10:21 +0000 (16:10 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Sat, 9 Oct 2021 23:10:21 +0000 (16:10 -0700)
doc/matrices.texi
doc/pspp.texi
src/language/stats/matrix.c

index 113875a1f75bcf2d6c23a230e5da2e48b498b916..03448eea30239f070db197a82cbadaa842569772 100644 (file)
@@ -1397,15 +1397,18 @@ Returns the @math{@var{k}@times{}@var{n}} matrix @var{A} that is the
 
 
 @deffn {Matrix Function} GSCH (@var{M})
+@var{M} must be a @math{@var{n}@times{}@var{m}} matrix, @math{@var{m}
+@geq{} @var{n}}, with rank @var{n}.  Returns an
+@math{@var{n}@times{}@var{n}} orthonormal basis for @var{M}, obtained
+using the Gram-Schmidt process.
 @end deffn
 
-
 @deffn {Matrix Function} INV (@var{M})
 Returns the @math{@var{n}@times{}@var{n}} matrix @var{A} that is the
 inverse of @math{@var{n}@times{}@var{n}} matrix @var{M}, defined such
 that @math{@var{M}@times{}@var{A} = @var{A}@times{}@var{M} = I}, where
 @var{I} is the identity matrix.  @var{M} must not be singular, that
-is, @math{\det(@var{M}) \ne 0}.
+is, @math{\det(@var{M}) @ne{} 0}.
 @end deffn
 
 @deffn {Matrix Function} KRONEKER (@var{Ma}, @var{Mb})
@@ -1426,16 +1429,41 @@ equivalently, by its rows.
 @end deffn
 
 @deffn {Matrix Function} SOLVE (@var{Ma}, @var{Mb})
-
+@var{Ma} must be an @math{@var{n}@times{}@var{n}} matrix, with
+@math{\det(@var{Ma}) @ne{} 0}, and @var{Mb} an
+@math{@var{n}@times{}@var{k}} matrix.  Returns an
+@math{@var{n}@times{}@var{k}} matrix @var{X} such that @math{@var{Ma}
+@times{} @var{X} = @var{Mb}}.
 @end deffn
 
 @deffn {Matrix Function} SVAL (@var{M})
+Given @math{@var{n}@times{}@var{k}} matrix @var{M}, returns a
+@math{\min(@var{n},@var{k})}-element column vector containing the
+singular values of @var{M} in descending order.
 @end deffn
 
+@deffn {Matrix Function} SWEEP (@var{M}, @var{nk})
+Given @math{@var{r}@times{}@var{c}} matrix @var{M} and integer scalar
+@math{k = @var{nk}} such that @math{1 @leq{} k @leq{}
+\min(@var{r},@var{c})}, returns the @math{@var{r}@times{}@var{c}}
+sweep matrix @var{A}.
 
-@deffn {Matrix Function} SWEEP (@var{M}, @var{n})
-@end deffn
+If @math{@var{M}_{kk} @ne{} 0}, then:
+
+@display
+@math{@var{A}_{kk} = 1/@var{M}_{kk}},
+@math{@var{A}_{ik} = -@var{M}_{ik}/@var{M}_{kk} @r{for} i @ne{} k},
+@math{@var{A}_{kj} = @var{M}_{kj}/@var{M}_{kk} @r{for} j @ne{} k, @r{and}}
+@math{@var{A}_{ij} = @var{M}_{ij} - (@var{M}_{ik} * @var{M}_{kj}) / @var{M}_{kk} @r{for} i @ne{} k @r{and} j @ne{} k}.
+@end display
+
+If @math{@var{M}_{kk} = 0}, then:
 
+@display
+@math{@var{A}_{ik} = @var{A}_{ki} = 0 @r{and}}
+@math{@var{A}_{ij} = @var{M}_{ij}, @r{for} i @ne{} k @r{and} j @ne{} k}.
+@end display
+@end deffn
 
 @node Matrix IO
 @subsubsection I/O
index 26550b763ed0e6ef74e753dba068a8811cb3978b..204feada5862577aad02fbdf37cbf51b6c870e80 100644 (file)
@@ -94,6 +94,9 @@ graphic user interface
 @macro times{}
 ×
 @end macro
+@macro ne{}
+≠
+@end macro
 @end ifnottex
 
 @c A macro to indicate variable names used in examples.
index 558841a9e0199a724c1c380dca9503cca0579e64..be635f9bad85012b7f784ec17e1639b9c9be7fa7 100644 (file)
@@ -904,7 +904,7 @@ matrix_eval_GSCH (gsl_matrix *v)
   if (v->size2 < v->size1)
     {
       msg (SE, _("GSCH requires its argument to have at least as many columns "
-                 "as rows, but it has dimensions (%zu,%zu)."),
+                 "as rows, but it has dimensions %zu×%zu."),
            v->size1, v->size2);
       return NULL;
     }
@@ -1442,8 +1442,8 @@ matrix_eval_SOLVE (gsl_matrix *m1, gsl_matrix *m2)
   if (m1->size1 != m2->size1)
     {
       msg (SE, _("SOLVE requires its arguments to have the same number of "
-                 "rows, but the first argument has dimensions (%zu,%zu) and "
-                 "the second (%zu,%zu)."),
+                 "rows, but the first argument has dimensions %zu×%zu and "
+                 "the second %zu×%zu."),
            m1->size1, m1->size2,
            m2->size1, m2->size2);
       return NULL;