aboutsummaryrefslogtreecommitdiffstats
path: root/statistics
diff options
context:
space:
mode:
Diffstat (limited to 'statistics')
-rw-r--r--statistics/cstat.hpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/statistics/cstat.hpp b/statistics/cstat.hpp
index 4a647e1..7193a93 100644
--- a/statistics/cstat.hpp
+++ b/statistics/cstat.hpp
@@ -6,7 +6,10 @@
#define CSTAT_HPP
#define OPT_HEADER
#include <core/fitter.hpp>
+#include <math/vector_operation.hpp>
#include <iostream>
+#include <cassert>
+
using std::cout;using std::endl;
namespace opt_utilities
@@ -50,7 +53,7 @@ namespace opt_utilities
for(int i=(this->get_data_set()).size()-1;i>=0;--i)
{
Ty model_y=eval_model(this->get_data_set().get_data(i).get_x(),p);
- result-=this->get_data_set().get_data(i).get_y()*std::log(model_y);
+ result-=contract(this->get_data_set().get_data(i).get_y(),std::log(model_y),result);
}
if(verb)