commiting a hackgit diff! attention
This commit is contained in:
@@ -91,7 +91,12 @@ namespace Distribution {
|
|||||||
Assert::notEqual(numElements, 0, "data is empty, thats not enough for getting the distribution!");
|
Assert::notEqual(numElements, 0, "data is empty, thats not enough for getting the distribution!");
|
||||||
|
|
||||||
const Eigen::MatrixXd centered = data.rowwise() - mean.transpose();
|
const Eigen::MatrixXd centered = data.rowwise() - mean.transpose();
|
||||||
const Eigen::MatrixXd cov = (centered.adjoint() * centered) / double(data.rows() - 1);
|
Eigen::MatrixXd cov = (centered.adjoint() * centered) / double(data.rows() - 1);
|
||||||
|
|
||||||
|
//this is a hack
|
||||||
|
if(cov(2,2) < 0.1){
|
||||||
|
cov(2,2) = 0.1;
|
||||||
|
}
|
||||||
|
|
||||||
return NormalDistributionN(mean, cov);
|
return NormalDistributionN(mean, cov);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user