Patterns in static

Apophenia

apop_t_f_chi.c File Reference

Data Structures

Functions

Variables


Detailed Description

t, F, chi squared, and Wishart distributions.


Function Documentation

int apop_matrix_is_positive_semidefinite ( gsl_matrix *  m,
char  semi 
)

Test whether the input matrix is positive semidefinite.

A covariance matrix will always be PSD, so this function can tell you whether your matrix is a valid covariance matrix.

Consider the 1x1 matrix in the upper left of the input, then the 2x2 matrix in the upper left, on up to the full matrix. If the matrix is PSD, then each of these has a positive determinant. This function thus calculates $N$ determinants for an $N$x$N$ matrix.

Parameters:
m The matrix to test. If NULL, I will return zero---not PSD.
semi If anything but 's', check for positive definite, not semidefinite. (default 's')

See also apop_matrix_to_positive_semidefinite, which will change the input to something PSD.

This function uses the Designated initializers syntax for inputs.

double apop_matrix_to_positive_semidefinite ( gsl_matrix *  m  ) 

First, this function passes tests, but is under development.

It takes in a matrix and converts it to the `closest' positive semidefinite matrix.

Parameters:
m On input, any matrix; on output, a positive semidefinite matrix.
Returns:
the distance between the original and new matrices.

See also the test function apop_matrix_is_positive_semidefinite.

Adapted from the R Matrix package's nearPD, which is Copyright (2007) Jens Oehlschlägel [and is GPL].

double apop_multivariate_gamma ( double  a,
double  p 
)

The multivariate generalization of the Gamma distribution. $ \Gamma_p(a)= \pi^{p(p-1)/4}\prod_{j=1}^p \Gamma\left[ a+(1-j)/2\right]. $

See also apop_multivariate_lngamma, which is more numerically stable in most cases.

double apop_multivariate_lngamma ( double  a,
double  p 
)

The log of the multivariate generalization of the Gamma; see also apop_multivariate_gamma.

SourceForge.net Logo

Autogenerated by doxygen on 23 Nov 2009.