This test creates a one dimensional Gaussian with a random mean and variance. It then samples from this distribution and calculates the sample mean and variance for comparison.
Results are as follows:
True mean = 4.10067 True variance = 2.01401 Sample mean = 4.0981 Sample variance = 2.0278
Definition in file test1.cpp.
Go to the source code of this file.
Namespaces | |
| namespace | std |
Functions | |
| int | main (int argc, const char *argv[]) |
| Run tests. | |
Variables | |
| unsigned int | N = 100000 |
| Number of samples to take. | |
1.5.3