~ Insights of a modern alchemist

What’s new in futile.matrix 1.1.2

This is an exciting release of futile.matrix, which in some ways the package grows up and finds its purpose. It now includes a suite of functions for generating random matrices and can be used in conjunction with RMTstat. In short, futile.matrix has two purposes:

Investigating the properties of random matrices

Fitting distributions and finding the upper cutoff on the noise part of the eigenvalue spectrum

This post will focus on the first purpose, that of exploring random matrices. It is meant to be an overview of functions available in the package and not a rigorous treatment of the subject matter.

Random Matrices

The package provides a number of types for describing random matrices. These types are strictly model parameters that are used to generate random matrices. Supported matrix classes include Wigner matrices, Wishart matrices, and Jacobian matrices.

Wigner Matrix

A Wigner matrix is a symmetric matrix with random Gaussian entries. To generate a matrix of this class we can create a model and then call the matrix generator. Once we create a matrix we can plot a histogram of the eigenvalues, which conforms to the Wigner semicircle law.

As expected, the histogram for this variant also conforms to the semi-circle law.

Wishart Matrix

In finance, a more useful matrix is a Wishart matrix, which is a sample covariance matrix. These matrices have an eigenvalue spectrum that is described by the Marcenko-Pastur distribution.

As an example, we’ll create a random Wishart matrix that is similar to two years of daily data on the S&P 500. We plot the actual distribution of eigenvalues alongside the theoretical distribution (generated from the RMTstat package).

Fitting the spectrum to a theoretical curve enables you to isolate the noise part of the spectrum. Once this is established, it’s possible to clean the source correlation matrix and remove the estimation error.

Matrix Ensembles

Additional properties of random matrices can be discerned by analyzing ensembles of said matrices. We can generate the ensemble based on an existing model along with a count. Since an ensemble contains many random matrices, there is no practical way of displaying its contents. Hence, only some basic information is printed to reduce screen clutter.

Conclusion

This post covered the basic functions of futile.matrix and how one can analyze random matrices and their ensembles using the package. In a subsequent post, we’ll cover using the package to fit distributions and identifying the cutoff point for the noise portion of the eigenvalue spectrum.