From 9fcda2d737def25854456a64d4d8c6f24771341f Mon Sep 17 00:00:00 2001 From: astrojhgu Date: Sun, 16 Aug 2009 11:32:47 +0000 Subject: git-svn-id: file:///home/svn/opt_utilities@41 ed2142bd-67ad-457f-ba7c-d818d4011675 --- samples/a | Bin 9817 -> 0 bytes samples/a.cc | 36 ------------------------------------ statistics/cstat.hpp | 18 ++++++++---------- 3 files changed, 8 insertions(+), 46 deletions(-) delete mode 100755 samples/a delete mode 100644 samples/a.cc diff --git a/samples/a b/samples/a deleted file mode 100755 index b8b8e8c..0000000 Binary files a/samples/a and /dev/null differ diff --git a/samples/a.cc b/samples/a.cc deleted file mode 100644 index 1cf92df..0000000 --- a/samples/a.cc +++ /dev/null @@ -1,36 +0,0 @@ -#include -#include -#include -using namespace std; - -double powerlaw(double x) -{ - return 5*pow(x,-1.1); -} - -double bpl(double x) -{ - double x_b=5; - double f_b=10; - double gamma1=-0.8; - double gamma2=-1.5; - if(x>x>>x1>>x2>>y>>y1>>y2) - { - cout< - class cstat_poisson + class cstat :public statistic { private: bool verb; int n; - - Ty lnfrac(Ty y)const - { - return y*log(y)-y; - } - public: + cstat() + :verb(true) + {} + void verbose(bool v) { verb=v; @@ -29,7 +27,7 @@ namespace opt_utilities statistic* do_clone()const { // return const_cast*>(this); - return new cstat_poisson(*this); + return new cstat(*this); } Ts do_eval(const Tp& p) @@ -38,7 +36,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+=model_y-this->get_data_set().get_data(i).get_y()*log(model_y)+lnfrac(this->get_data_set().get_data(i).get_y()); + result-=this->get_data_set().get_data(i).get_y()*std::log(model_y); } if(verb) @@ -46,7 +44,7 @@ namespace opt_utilities n++; if(n%10==0) { - cout<p_fitter->get_dof()<<"\t"; + cout<<"a:"<