Matrix Operations in Statistica

Matrix Operations in Statistica

book

Article ID: KB0083706

calendar_today

Updated On:

Products Versions
Spotfire Statistica 13.0, 13.1, 13.2, 13.3

Description

Statistica can do various Matrix operations through SVB coding. 

Environment

Windows 7, Windows Server 2012 R2

Resolution

Matrix operations, such as matrix addition, matrix correlation, matrix inversion, matrix multiplication, matrix eigenvalues, etc, can be done through Statistica SVB coding. 

1. SVB library of Matrix Operations functions
Summary of various Matrix Operations functions.
Individual usage  of various Matrix Operation functions .

2. How to load spreadsheet data into a Matrix object in SVB for matrix operations?
The .Data property of a spreadsheet object returns the Spreadsheet data as a two-dimensional array of Doubles. The array is 1-referenced in each dimension, i.e., the first element in the array is s(1,1). The Spreadsheet data array could then be copied to a Matrix array through function "MatrixDuplicate".

---------------- For Example ---------------------------------------------
Sub Main

Dim s As Spreadsheet
Set s = ActiveSpreadsheet
nr = s.NumberOfCases
nv = s.NumberOfVariables
Dim Matrix() As Double
ReDim Matrix(nr, nv)
' copy spreadsheet data to Matrix
MatrixObject.MatrixDuplicate(s.Data, Matrix())
' display Matrix() for checking
MatrixObject.MatrixDisplay(Matrix(), "InputSpreadsheetReadIntoMatrix")
 
End Sub
----------------------------------------------------------------------------------

3. How to Copy the contents of a Matrix array object to a spreadsheet object in SVB?
Example on copying a matrix object contents to a spreadsheet

4. How to read input spreadsheet node and make downstream output spreadsheet in SVB?
Example on reading input spreadsheet node data and making downstream output spreadsheet in SVB node

5. An example workspace is attached under this KB, with a SVB node taking upstream input spreadsheet nodes' data, performing Matrix multiplication, and making result matrix as downstream spreadsheet

User-added image
 

Issue/Introduction

This article introduces Matrix operations in Statistica, e.g how to do matrix * matrix multiplication in Statistica.

Attachments

Matrix Operations in Statistica get_app