Matrix Calculations
See Also
This menu can be used to create an expression to perform a matrix calculation. The expression is displayed at the top of the menu and can be constructed step by step by combining data structures and operators. The operators displayed are specifically for matrices, but more general functions can be accessed using the additional functions button. Brackets can be used to control the order of evaluation when required. You can also type directly into the expression box. For more general calculations the calculate menu can be used.

Calculation

Provides a space to enter an expression for the calculation. This can be typed in directly or built up by clicking names in the Available Data or Standard Matrices lists together with operators or functions.

Available Data

This lists the matrices (rectangular, symmetric and diagonal) and their sizes (rows x columns) that are available for calculations. Rectangular, symmetric and diagonal matrices names are prefixed with M:, S: and D: respectively to display the type of each matrix. This list can be supplemented with variates and scalars using the Available Data Includes option. Double-clicking an identifier name will copy the name into the calculation field at the current cursor position.

Available Data Includes

These options allow scalars and variates to be displayed in the Available Data list.
Scalars (N:)scalars will be displayed in the Available Data list with the name prefixed with a N:.
Variates (V:)variates will be displayed in the Available Data list with the name prefixed with a V:.

Save In

Specifies the name of the matrix (or scalar) to save the result from the calculation.

Display in Spreadsheet

When selected, the matrix resulting from the calculation will be displayed in a spreadsheet.

Print in Output

When selected, the matrix resulting from the calculation will be printed in the Output window.

Standard Matrices

This lists various standard matrices that are available for calculations. The size of the standard matrix is specified in the rows and Columns fields. Double-clicking a matrix type in the list will copy the name within the calculation field at the current cursor position.

Operations

These buttons specify various matrix operations. Clicking a button will place that function into the calculation list. If text is currently selected in the calculation field, then this will be inserted as the first argument of the function.
OperationGenStat expressionDefinitionDescription
ProductA *+ BABmatrix product or multiplication
TraceTRACE(A)tr Athe trace of a matrix.
Direct ProductDPRODUCT(A;B)A Ä Bmatrix direct product.
TransposeT(A)A'matrix transpose
DiagonalDIAGONAL(A)extract the diagonal of a matrix.
Quadratic Product T(A)*+X*+AA'XA matrix quadratic product.
InverseINVERSE(A)A-1the inverse of a matrix.
DeterminantDET(A)|A|the determinant of a matrix.
Choleski Decomp.CHOLESKI(A)L: A = LL' - the Choleski decomposition of a matrix.
EigenvaluesEVALUES(A)the eigenvalues of a matrix.
EigenvectorsEVECTORS(A)the eigenvectors of a matrix.
Singular ValuesSVALUES(A)the singular values of a matrix.
Left Singular VectorsLSVECTORS(A)the left singular vectors of a matrix.
Right Singular VectorsRSVECTORS(A)the right singular vectors of a matrix.

Elementwise

These buttons specify various scalar operations that will be applied to each element of the matrix. Clicking the button will place the function into the calculation list. If text is currently selected in the calculation field, then this will be inserted as the first argument of the function.

OperationDescription
+elementwise addition.
-elementwise subtraction.
*elementwise multiplication.
/elementwise division.
Expelementwise exponential function.
Log eelementwise natural logarithm.
Sqrtelementwise square root.
Abselementwise absolute value.

Note that the dimensions of the two matrices must match exactly for the operators +, -, * and /.

Additional Functions

This opens a functions dialog where you can select a function from a more general set of functions.

Action Buttons

RunRun the calculation.
CancelClose the menu without further changes.

See Also