Skip to content

Commit

Permalink
simplify equation
Browse files Browse the repository at this point in the history
  • Loading branch information
takenori-y committed Nov 1, 2023
1 parent 8163414 commit da31754
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/math/statistics_accumulation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -382,8 +382,7 @@ bool StatisticsAccumulation::Merge(
for (int i(0); i <= num_order_; ++i) {
for (int j(diagonal_ ? i : 0); j <= i; ++j) {
buffer->second_order_statistics_[i][j] +=
second[i][j] + c * ((mu1[i] * mu1[j] + mu2[i] * mu2[j]) -
(mu1[i] * mu2[j] + mu2[i] * mu1[j]));
second[i][j] + c * (mu1[i] - mu2[i]) * (mu1[j] - mu2[j]);
}
}
} else {
Expand Down
7 changes: 3 additions & 4 deletions src/utils/misc_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -315,10 +315,9 @@ bool ComputeLowerAndUpperBounds(double confidence_level, int num_data,
const std::vector<double> variance,
std::vector<double>* lower_bound,
std::vector<double>* upper_bound) {
if (confidence_level <= 0.0 ||
100.0 <= confidence_level ||
num_data <= 0 || mean.size() != variance.size() ||
NULL == lower_bound || NULL == upper_bound) {
if (confidence_level <= 0.0 || 100.0 <= confidence_level || num_data <= 0 ||
mean.size() != variance.size() || NULL == lower_bound ||
NULL == upper_bound) {
return false;
}

Expand Down

0 comments on commit da31754

Please sign in to comment.