Gaussian random vectors in WOLF: We've been wrong for a long time
Eigen
method Random
and setRandom
produce unnifirm distributions in the range [-1,1].
In WOLF we are using random numbers to generate Gaussian noise. We have been using Eigen::Random
, which is wrong.
To generate random vectors and matrices with arbitrary random distributions, Eigen's guru Gael Guennebaud recommends the following:
#include <Eigen/Sparse>
#include <iostream>
#include <random>
using namespace Eigen;
int main() {
std::default_random_engine generator;
std::poisson_distribution<int> distribution(4.1);
auto poisson = [&] (int) {return distribution(generator);};
RowVectorXi v = RowVectorXi::NullaryExpr(10, poisson );
std::cout << v << "\n";
}
We should provide such mechanism in WOLF so that we can make tests with true Gaussian noises.
We can read more here: