This test creates a multivariate Gaussian with a random mean and covariance. It then samples from this distribution and calculates the sample mean and variance for comparison.
Results are as follows:
True mean [10](2.48593,0.527838,-4.03316,-2.29571,3.8182,0.134282,0.711423,-2.24192,-0.525817,2.36117) True covariance [10,10]((5.2996,3.76554,9.87503,0.163168,1.04418,7.05295,3.90119,3.27845,3.94447,9.53792),(3.76554,8.61344,15.1256,3.60221,1.40435,5.79514,11.9096,9.41211,5.92571,15.4022),(9.87503,15.1256,29.4758,5.1878,2.98618,14.2531,19.856,15.9284,11.7217,29.5768),(0.163168,3.60221,5.1878,23.4589,19.6533,17.5165,18.7502,22.3648,19.2339,14.6441),(1.04418,1.40435,2.98618,19.6533,20.8607,15.9305,17.0691,22.8217,17.9654,11.7447),(7.05295,5.79514,14.2531,17.5165,15.9305,34.9311,16.8792,18.5106,21.8439,30.3632),(3.90119,11.9096,19.856,18.7502,17.0691,16.8792,48.6559,39.424,35.864,44.2356),(3.27845,9.41211,15.9284,22.3648,22.8217,18.5106,39.424,51.0374,40.4483,41.8792),(3.94447,5.92571,11.7217,19.2339,17.9654,21.8439,35.864,40.4483,54.1987,48.9025),(9.53792,15.4022,29.5768,14.6441,11.7447,30.3632,44.2356,41.8792,48.9025,73.983)) Sample mean [10](2.4831,0.519928,-4.04644,-2.28977,3.82506,0.139141,0.722988,-2.22356,-0.505592,2.37538) Sample covariance [10,10]((5.33786,3.797,9.95163,0.0875381,0.975405,7.05539,3.88719,3.21349,3.92007,9.58669),(3.797,8.64569,15.1975,3.5903,1.38219,5.82425,11.9306,9.39131,5.87093,15.4476),(9.95163,15.1975,29.6417,5.10373,2.89421,14.2944,19.8719,15.8418,11.6251,29.6823),(0.0875381,3.5903,5.10373,23.4683,19.629,17.4515,18.6911,22.3621,19.2122,14.6253),(0.975405,1.38219,2.89421,19.629,20.8318,15.8612,17.0473,22.8026,17.9806,11.7469),(7.05539,5.82425,14.2944,17.4515,15.8612,34.9387,16.8448,18.4564,21.8353,30.4156),(3.88719,11.9306,19.8719,18.6911,17.0473,16.8448,48.7196,39.4465,35.6875,44.3061),(3.21349,9.39131,15.8418,22.3621,22.8026,18.4564,39.4465,51.0476,40.3929,41.9198),(3.92007,5.87093,11.6251,19.2122,17.9806,21.8353,35.6875,40.3929,54.0829,48.8377),(9.58669,15.4476,29.6823,14.6253,11.7469,30.4156,44.3061,41.9198,48.8377,74.1816))
Definition in file test2.cpp.
Go to the source code of this file.
Functions | |
| int | main (int argc, const char *argv[]) |
| Run tests. | |
Variables | |
| unsigned int | M = 10 |
| Dimensionality of the Gaussian. | |
| unsigned int | N = 100000 |
| Number of samples to take. | |
1.5.2