removed some hacks
This commit is contained in:
@@ -93,11 +93,6 @@ namespace Distribution {
|
|||||||
const Eigen::MatrixXd centered = data.rowwise() - mean.transpose();
|
const Eigen::MatrixXd centered = data.rowwise() - mean.transpose();
|
||||||
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -56,8 +56,8 @@ namespace Divergence {
|
|||||||
|
|
||||||
// calc PQratio
|
// calc PQratio
|
||||||
if(Q[i] == 0.0){
|
if(Q[i] == 0.0){
|
||||||
//Assert::doThrow("Division by zero is not allowed ;).");
|
Assert::doThrow("Division by zero is not allowed ;).");
|
||||||
PQratio = P[i] / 0.00001;
|
//PQratio = P[i] / 0.00001;
|
||||||
} else {
|
} else {
|
||||||
PQratio = P[i] / Q[i];
|
PQratio = P[i] / Q[i];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,8 +68,8 @@ private:
|
|||||||
const float stdDev = std::sqrt(avg2 - avg*avg);
|
const float stdDev = std::sqrt(avg2 - avg*avg);
|
||||||
|
|
||||||
// avg rssi score
|
// avg rssi score
|
||||||
const float minRSSI = -90;
|
const float minRSSI = -90;
|
||||||
const float maxRSSI = -65;
|
const float maxRSSI = -75;
|
||||||
float score1 = (avg-minRSSI) / (maxRSSI-minRSSI); // min = 0; max = 1
|
float score1 = (avg-minRSSI) / (maxRSSI-minRSSI); // min = 0; max = 1
|
||||||
if (score1 > 1) {score1 = 1;}
|
if (score1 > 1) {score1 = 1;}
|
||||||
if (score1 < 0) {score1 = 0;}
|
if (score1 < 0) {score1 = 0;}
|
||||||
|
|||||||
Reference in New Issue
Block a user