wishart_matrix


wishart_matrix, an Octave code which produces sample matrices from the Wishart or Bartlett distributions, useful for sampling random covariance matrices.

The Wishart distribution is a probability distribution for random nonnegative-definite NxN matrices that can be used to select random covariance matrices.

The objects of the distribution are NxN matrices which are the sum of DF rank-one matrices X*X' constructed from N-vectors X, where the vectors X have zero mean and covariance SIGMA. This implies that the expected value of a Wishart matrix is DF * SIGMA.

A simplified version of the Wishart distribution assumes that SIGMA is the identity matrix. We will call this the "unit Wishart distribution".

Because any Wishart matrix W is symmetric nonnegative definite, there is an upper triangular factor T so that W = T' * T. There is a corresponding Bartlett distribution of the matrices T, so that one can alternatively sample the Bartlett distribution by sampling the Bartlett distribution for T, and then forming W.

In order to generate the necessary random values, the library relies on the PDFLIB and RNGLIB libraries.

Licensing:

The computer code and data files made available on this web page are distributed under the MIT license

Languages:

wishart_matrix is available in a C version and a C++ version and a Fortran90 version and a MATLAB version and an Octave version.

Related Data and Programs:

wishart_matrix_test

asa053, an Octave code which produces sample matrices from the Wishart distribution, by William Smith and Ronald Hocking. This is a version of Applied Statistics Algorithm 53.

jordan_matrix, an Octave code which returns a random matrix in Jordan canonical form.

levenshtein_matrix, an Octave code which returns the Levenshtein distance matrix defined by two strings.

magic_matrix, an Octave code which computes a magic matrix, for any odd order n, such that all rows and columns have the same sum.

monopoly_matrix, an Octave code which computes the adjacency and transition matrices for the game of Monopoly.

pdflib, an Octave code which evaluates Probability Density Functions (PDF's) and produces random samples from them, including beta, binomial, chi, exponential, gamma, inverse chi, inverse gamma, multinomial, normal, scaled inverse chi, and uniform.

plasma_matrix, an Octave code which sets up a matrix associated with a problem in plasma physics.

ranlib, an Octave code which produces random samples from Probability Density Functions (PDF's), including Beta, Chi-square Exponential, F, Gamma, Multivariate normal, Noncentral chi-square, Noncentral F, Univariate normal, random permutations, Real uniform, Binomial, Negative Binomial, Multinomial, Poisson and Integer uniform, by Barry Brown and James Lovato.

risk_matrix, an Octave code which computes the transition and adjacency matrix for the game of RISK.

rnglib, an Octave code which implements a random number generator (RNG) with splitting facilities, allowing multiple independent streams to be computed, by L'Ecuyer and Cote.

snakes_matrix, an Octave code which computes the transition matrix for Snakes and Ladders.

test_matrix, an Octave code which defines test matrices for which the condition number, determinant, eigenvalues, eigenvectors, inverse, null vectors, P*L*U factorization or linear system solution are known. Examples include the Fibonacci, Hilbert, Redheffer, Vandermonde, Wathen and Wilkinson matrices.

usa_matrix, an Octave code which defines the adjacency matrix for US states, using a variety of matrix formats.

wathen_matrix, an Octave code which compares storage schemes (full, banded, sparse triplet, sparse) and solution strategies (A\x, linpack, conjugate gradient (CG)) for linear systems involving the Wathen matrix, which can arise when solving a problem using the finite element method (FEM).

web_matrix, an Octave code which stores sample matrices describing a web page network. These matrices are typically very sparse, and the examples here are stored using the sparse triplet (ST) format. They can be used to demonstrate pagerank and other graph algorithms.

Reference:

Source Code:


Last revised on 30 September 2022.