Statistica Matrix and Statistical Function Libraries

Statistica Visual Basic contains a large number of designated matrix and statistical functions that make the SVB environment ideal for prototyping algorithms or for developing custom statistical procedures. The matrix and statistical functions are documented in detail in Statistica matrix function library.

One major advantage of using the Statistica library of matrix functions, instead of writing these functions "by hand" in Visual Basic is that the former will evaluate much faster. For example, when you want to invert large matrices, the MatrixInverse function will perform the actual matrix inversion using the highly optimized (compiled) algorithms of Statistica.

Accessing data in spreadsheets
In many cases you may want to access the data in a spreadsheet via the matrix functions. You can of course use the spreadsheet .Value(i,j) property to retrieve and set individual values in a data spreadsheet (see also Creating a custom spreadsheet). In addition, three specialized spreadsheet properties provide more efficient methods for transferring data to and from matrices suitable for use with Statistica matrix functions: Data, VData(i), and Cdata(i).  The .Data property will transfer all data in a spreadsheet to a two-dimensional array (matrix), and back; the .VData(i) property will transfer only specific variables or columns (the i'th column); the CData(i) property will transfer only specific cases or rows (the i'th row). These properties are illustrated in examples below.
Include file: STB.SVX.
To provide convenient access to the matrix functions without requiring you to pass explicitly the dimensions of the arrays that are being passed, Statistica includes a file with function interfaces: STB.svx. You may want to open this file to review the functions, and how they provide simplified access to the actual matrix library. It is recommended that you routinely include that file at the beginning of your program when you intend to use functions from the Statistica libraries of matrix and statistical functions (e.g., '$Include: "*STB.SVX").

In order to ensure the portability of all Statistica Visual Basic macros, you can specify an asterisk in front of the root file name for the standard include files. When Statistica detects the *, it will automatically search for the STB.svx file in standard places (e.g., the directory where the macro has been saved, the global macro directory, and the directory where the Statistica application is located). Thus it is not necessary to state the complete path for the STB.svx file when including this file in your Statistica Visual Basic programs via the $Include statement.