From: Ben Pfaff Date: Fri, 23 Oct 2026 20:21:56 +0000 (-0700) Subject: Update MATRIX documentation. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fheads%2Frust6;p=pspp Update MATRIX documentation. --- diff --git a/rust/doc/src/commands/matrix.md b/rust/doc/src/commands/matrix.md index ff1b65403e..dc0c7ec57f 100644 --- a/rust/doc/src/commands/matrix.md +++ b/rust/doc/src/commands/matrix.md @@ -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)`