]> pintos-os.org Git - pspp/commitdiff
Update MATRIX documentation. rust6
authorBen Pfaff <blp@cs.stanford.edu>
Fri, 23 Oct 2026 20:21:56 +0000 (13:21 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Fri, 23 Oct 2026 20:21:56 +0000 (13:21 -0700)
rust/doc/src/commands/matrix.md

index ff1b65403eb353a5d369d53eb0c4c2f6b45cc3f1..dc0c7ec57fe6654b2ad081882f01818f13fa7454 100644 (file)
@@ -679,17 +679,21 @@ like the [elementwise operators](#elementwise-binary-operators).
   `CMAX(M)`  
   `CSUM(M)`  
   `CSSQ(M)`  
+  `MEAN(M)`  
      Returns a row vector with the same number of columns as `M`, in
-     which each element is the minimum, maximum, sum, or sum of
-     squares, respectively, of the elements in the same column of `M`.
+     which each element is the minimum, maximum, sum, sum of squares,
+     or mean, respectively, of the elements in the same column of `M`.
 
      ```
-     CMIN({1, 2, 3; 4, 5, 6; 7, 8, 9} ⇒ {1, 2, 3}
-     CMAX({1, 2, 3; 4, 5, 6; 7, 8, 9} ⇒ {7, 8, 9}
-     CSUM({1, 2, 3; 4, 5, 6; 7, 8, 9} ⇒ {12, 15, 18}
-     CSSQ({1, 2, 3; 4, 5, 6; 7, 8, 9} ⇒ {66, 93, 126}
+     CMIN({1, 2, 3; 4, 5, 6; 7, 8, 9}) ⇒ {1, 2, 3}
+     CMAX({1, 2, 3; 4, 5, 6; 7, 8, 9}) ⇒ {7, 8, 9}
+     CSUM({1, 2, 3; 4, 5, 6; 7, 8, 9}) ⇒ {12, 15, 18}
+     CSSQ({1, 2, 3; 4, 5, 6; 7, 8, 9}) ⇒ {66, 93, 126}
+     MEAN({1, 2, 3; 4, 5, 6; 7, 8, 9}) ⇒ {4, 5, 6}
      ```
 
+     `MEAN` is a PSPP extension.
+
 * `MMIN(M)`  
   `MMAX(M)`  
   `MSUM(M)`  
@@ -698,10 +702,10 @@ like the [elementwise operators](#elementwise-binary-operators).
      of the elements of `M`.
 
      ```
-     MMIN({1, 2, 3; 4, 5, 6; 7, 8, 9} ⇒ 1
-     MMAX({1, 2, 3; 4, 5, 6; 7, 8, 9} ⇒ 9
-     MSUM({1, 2, 3; 4, 5, 6; 7, 8, 9} ⇒ 45
-     MSSQ({1, 2, 3; 4, 5, 6; 7, 8, 9} ⇒ 285
+     MMIN({1, 2, 3; 4, 5, 6; 7, 8, 9}) ⇒ 1
+     MMAX({1, 2, 3; 4, 5, 6; 7, 8, 9}) ⇒ 9
+     MSUM({1, 2, 3; 4, 5, 6; 7, 8, 9}) ⇒ 45
+     MSSQ({1, 2, 3; 4, 5, 6; 7, 8, 9}) ⇒ 285
      ```
 
 * `RMIN(M)`  
@@ -713,10 +717,10 @@ like the [elementwise operators](#elementwise-binary-operators).
      squares, respectively, of the elements in the same row of `M`.
 
      ```
-     RMIN({1, 2, 3; 4, 5, 6; 7, 8, 9} ⇒ {1; 4; 7}
-     RMAX({1, 2, 3; 4, 5, 6; 7, 8, 9} ⇒ {3; 6; 9}
-     RSUM({1, 2, 3; 4, 5, 6; 7, 8, 9} ⇒ {6; 15; 24}
-     RSSQ({1, 2, 3; 4, 5, 6; 7, 8, 9} ⇒ {14; 77; 194}
+     RMIN({1, 2, 3; 4, 5, 6; 7, 8, 9}) ⇒ {1; 4; 7}
+     RMAX({1, 2, 3; 4, 5, 6; 7, 8, 9}) ⇒ {3; 6; 9}
+     RSUM({1, 2, 3; 4, 5, 6; 7, 8, 9}) ⇒ {6; 15; 24}
+     RSSQ({1, 2, 3; 4, 5, 6; 7, 8, 9}) ⇒ {14; 77; 194}
      ```
 
 * `SSCP(M)`  
@@ -734,6 +738,21 @@ like the [elementwise operators](#elementwise-binary-operators).
      TRACE(MDIAG(1:5)) ⇒ 15
      ```
 
+* `COV(M)`  
+   Returns a symmetric matrix whose diagonal elements are the variance
+   of the each column in `M` and whose off-diagonal elements are the
+   covariance of the two columns of the element's row and column.  For
+   example, if `M` is a `N`×2 matrix, the result is a 2×2 matrix `{a,
+   b; b, c}`, where `a` is the variance of `M`'s first column, `b` is
+   the covariance between `M`'s two columns, and `c` is the variance
+   of `M`'s second column.
+
+   ```
+   COV({80, 70; 63, 20; 100, 50})} ⇒ {343, 260; 260, 633.33}
+   ```
+
+   `COV` is a PSPP extension.
+
 ### Matrix Property Functions
 
 * `NROW(M)`