test7.cpp File Reference


Detailed Description

Test of GaussianMixturePdf with distributed storage.

This test creates a random multivariate Gaussian mixture with components distributed across several nodes. It goes on to test the various distributed methods to ensure invariance of the distribution under these manipulations.

Results follow.

2: 0 components, 0 weight
0: 50 components, 28.0715 weight

1: 0 components, 0 weight
3: 0 components, 0 weight
redistributeBySize() failed, difference is:
[10](-5.55112e-17,0,-3.33067e-16,0,1.17961e-16,0,1.52656e-16,4.85723e-17,0,-2.77556e-17)
[10,10]((8.88178e-16,-2.22045e-16,0,2.22045e-16,0,-4.44089e-16,2.22045e-16,0,-2.22045e-16,-3.33067e-16),(-2.22045e-16,-3.55271e-15,0,-1.11022e-16,4.44089e-16,-1.11022e-16,-2.77556e-17,1.77636e-15,-8.88178e-16,0),(0,0,-8.88178e-16,2.22045e-16,3.33067e-16,8.88178e-16,0,2.22045e-16,2.22045e-16,-2.22045e-16),(2.22045e-16,-1.11022e-16,2.22045e-16,-3.55271e-15,1.11022e-16,-1.11022e-15,-1.11022e-16,2.22045e-16,0,-6.66134e-16),(0,4.44089e-16,3.33067e-16,1.11022e-16,-1.77636e-15,-4.44089e-16,-1.11022e-16,4.44089e-16,6.66134e-16,0),(-4.44089e-16,-1.11022e-16,8.88178e-16,-1.11022e-15,-4.44089e-16,1.77636e-15,6.66134e-16,-2.22045e-16,-1.11022e-16,1.11022e-16),(2.22045e-16,-2.77556e-17,0,-1.11022e-16,-1.11022e-16,6.66134e-16,0,4.44089e-16,-2.77556e-16,4.44089e-16),(0,1.77636e-15,2.22045e-16,2.22045e-16,4.44089e-16,-2.22045e-16,4.44089e-16,0,2.22045e-16,4.44089e-16),(-2.22045e-16,-8.88178e-16,2.22045e-16,0,6.66134e-16,-1.11022e-16,-2.77556e-16,2.22045e-16,-4.44089e-15,1.11022e-16),(-3.33067e-16,0,-2.22045e-16,-6.66134e-16,0,1.11022e-16,4.44089e-16,4.44089e-16,1.11022e-16,3.55271e-15))

0: 13 components, 7.25074 weight

3: 12 components, 6.91111 weight
1: 13 components, 7.36847 weight
2: 12 components, 6.54116 weight
redistributeByWeight() failed, difference is:
[10](-5.55112e-17,5.55112e-17,-3.33067e-16,0,1.17961e-16,0,1.52656e-16,4.85723e-17,0,-2.77556e-17)
[10,10]((8.88178e-16,-2.22045e-16,0,2.22045e-16,-1.11022e-16,-4.44089e-16,2.22045e-16,0,-2.22045e-16,-3.33067e-16),(-2.22045e-16,-3.55271e-15,1.11022e-16,-5.55112e-17,4.44089e-16,-1.66533e-16,-2.77556e-17,1.77636e-15,-4.44089e-16,0),(0,1.11022e-16,-8.88178e-16,2.22045e-16,4.44089e-16,6.66134e-16,0,2.22045e-16,4.71845e-16,-2.22045e-16),(2.22045e-16,-5.55112e-17,2.22045e-16,-5.32907e-15,1.11022e-16,-1.11022e-15,-1.11022e-16,2.22045e-16,-1.66533e-16,-8.88178e-16),(-1.11022e-16,4.44089e-16,4.44089e-16,1.11022e-16,-1.77636e-15,-4.44089e-16,-1.11022e-16,4.44089e-16,6.66134e-16,0),(-4.44089e-16,-1.66533e-16,6.66134e-16,-1.11022e-15,-4.44089e-16,0,6.66134e-16,-2.22045e-16,-1.11022e-16,0),(2.22045e-16,-2.77556e-17,0,-1.11022e-16,-1.11022e-16,6.66134e-16,0,4.44089e-16,-2.77556e-16,4.44089e-16),(0,1.77636e-15,2.22045e-16,2.22045e-16,4.44089e-16,-2.22045e-16,4.44089e-16,0,2.22045e-16,6.66134e-16),(-2.22045e-16,-4.44089e-16,4.71845e-16,-1.66533e-16,6.66134e-16,-1.11022e-16,-2.77556e-16,2.22045e-16,-4.44089e-15,1.11022e-16),(-3.33067e-16,0,-2.22045e-16,-8.88178e-16,0,0,4.44089e-16,6.66134e-16,1.11022e-16,3.55271e-15))

0: 13 components, 7.25074 weight

3: 12 components, 6.91111 weight
1: 12 components, 7.24978 weight
2: 13 components, 6.65985 weight
rotate() failed, difference is:
[10](0,0,0,0,1.38778e-17,2.22045e-16,-2.77556e-17,0,0,0)
[10,10]((0,2.22045e-16,2.22045e-16,0,1.11022e-16,2.22045e-16,0,5.55112e-17,-2.22045e-16,0),(2.22045e-16,1.77636e-15,0,0,0,-1.11022e-16,2.77556e-17,0,-4.44089e-16,0),(2.22045e-16,0,0,0,0,-2.22045e-16,0,0,0,-2.22045e-16),(0,0,0,1.77636e-15,0,0,2.77556e-17,-2.22045e-16,1.66533e-16,2.22045e-16),(1.11022e-16,0,0,0,0,2.22045e-16,0,0,0,-4.44089e-16),(2.22045e-16,-1.11022e-16,-2.22045e-16,0,2.22045e-16,0,-2.22045e-16,0,-5.55112e-17,-5.55112e-17),(0,2.77556e-17,0,2.77556e-17,0,-2.22045e-16,0,0,1.11022e-16,0),(5.55112e-17,0,0,-2.22045e-16,0,0,0,0,0,-2.22045e-16),(-2.22045e-16,-4.44089e-16,0,1.66533e-16,0,-5.55112e-17,1.11022e-16,0,-8.88178e-16,0),(0,0,-2.22045e-16,2.22045e-16,-4.44089e-16,-5.55112e-17,0,-2.22045e-16,0,1.77636e-15))

0: 12 components, 7.24978 weight

1: 13 components, 6.65985 weight
2: 12 components, 6.91111 weight
3: 13 components, 7.25074 weight
distributedNormalise() failed, difference is:
[10](0,-1.66533e-16,-1.11022e-16,-1.11022e-16,-7.63278e-17,-2.22045e-16,0,-1.11022e-16,-1.11022e-16,8.32667e-17)
[10,10]((-1.77636e-15,-2.22045e-16,0,0,-4.44089e-16,-6.66134e-16,0,-2.22045e-16,4.44089e-16,-3.33067e-16),(-2.22045e-16,0,-3.33067e-16,2.22045e-16,2.22045e-16,3.88578e-16,-1.11022e-16,-8.88178e-16,0,-4.44089e-16),(0,-3.33067e-16,-8.88178e-16,0,-2.22045e-16,6.66134e-16,0,-6.66134e-16,-2.77556e-17,2.22045e-16),(0,2.22045e-16,0,0,-2.22045e-16,6.66134e-16,2.22045e-16,1.11022e-16,-2.77556e-16,2.22045e-16),(-4.44089e-16,2.22045e-16,-2.22045e-16,-2.22045e-16,-1.77636e-15,4.44089e-16,2.22045e-16,2.22045e-16,2.22045e-16,2.22045e-16),(-6.66134e-16,3.88578e-16,6.66134e-16,6.66134e-16,4.44089e-16,-1.77636e-15,0,2.22045e-16,1.66533e-16,6.66134e-16),(0,-1.11022e-16,0,2.22045e-16,2.22045e-16,0,-1.77636e-15,-8.88178e-16,0,-8.88178e-16),(-2.22045e-16,-8.88178e-16,-6.66134e-16,1.11022e-16,2.22045e-16,2.22045e-16,-8.88178e-16,1.77636e-15,2.22045e-16,0),(4.44089e-16,0,-2.77556e-17,-2.77556e-16,2.22045e-16,1.66533e-16,0,2.22045e-16,0,1.11022e-16),(-3.33067e-16,-4.44089e-16,2.22045e-16,2.22045e-16,2.22045e-16,6.66134e-16,-8.88178e-16,0,1.11022e-16,-3.55271e-15))

0: 12 components, 0.258261 weight
1: 13 components, 0.237246 weight
2: 12 components, 0.246197 weight
3: 13 components, 0.258296 weight

Definition in file test7.cpp.

Go to the source code of this file.

Functions

aux::GaussianPdf createRandomGaussian (const unsigned int M, const double minMean=-5.0, const double maxMean=5.0, const double minCov=0.0, const double maxCov=5.0)
 Create random Gaussian distribution.
bool isZero (const aux::vector &x)
 Determines whether a vector is the zero vector.
bool isZero (const aux::matrix &A)
 Determine whether a matrix is the zero matrix.
int main (int argc, char *argv[])
 Run tests.

Variables

unsigned int M = 10
 Dimensionality of the Gaussian mixture.
unsigned int COMPONENTS = 50
 Number of components in the Gaussian mixture.
unsigned int N = 10000
 Number of samples to take.


Function Documentation

aux::GaussianPdf createRandomGaussian ( const unsigned int  M,
const double  minMean = -5.0,
const double  maxMean = 5.0,
const double  minCov = 0.0,
const double  maxCov = 5.0 
)

Create random Gaussian distribution.

Parameters:
M Dimensionality of the Gaussian.
minMean Minimum value of any component of the mean.
maxMean Maximum value of any component of the mean.
minCov Minimum value of any component of the covariance.
maxCov Maximum value of any component of the covariance.
Returns:
Gaussian with given dimensionality, with mean and covariance randomly generated uniformly from within the given bounds.

Definition at line 62 of file test7.cpp.

bool isZero ( const aux::matrix &  A  ) 

Determine whether a matrix is the zero matrix.

Definition at line 102 of file test7.cpp.

bool isZero ( const aux::vector &  x  ) 

Determines whether a vector is the zero vector.

Definition at line 89 of file test7.cpp.

int main ( int  argc,
char *  argv[] 
)

Run tests.

Definition at line 117 of file test7.cpp.


Variable Documentation

unsigned int COMPONENTS = 50

Number of components in the Gaussian mixture.

Definition at line 42 of file test7.cpp.

unsigned int M = 10

Dimensionality of the Gaussian mixture.

Definition at line 37 of file test7.cpp.

unsigned int N = 10000

Number of samples to take.

Definition at line 47 of file test7.cpp.


Generated on Wed Dec 17 15:01:30 2008 for dysii Probability Distributions Test Suite by  doxygen 1.5.3