aboutsummaryrefslogtreecommitdiffstats
path: root/interface/perform_fit.hpp
blob: 3b1394e502031402e5b6e8889534df120f2731e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#ifndef PERFORM_FIT_HPP
#define PERFORM_FIT_HPP

/*
#include <statistics/chisq.hpp>
#include <statistics/cstat.hpp>
#include <data_sets/default_data_set.hpp>
#include <core/fitter.hpp>
#include <core/opt_traits.hpp>
#include <core/freeze_param.hpp>
#include <methods/powell/powell_method.hpp>
#include <models/gauss1d.hpp>
#include <models/bl1d.hpp>
#include <models/bpl1d.hpp>
#include <models/beta1d.hpp>
#include <models/dbeta1d.hpp>
#include <models/lin1d.hpp>
#include <models/poly1d.hpp>
#include <models/pl1d.hpp>
#include <models/models.hpp>
*/
#include <interface/type_depository.hpp>

namespace opt_utilities
{

  template <typename Ty,typename Tx,typename Tp,typename Ts,
	    typename Tstr>
  void perform_fit(const char* model_name,
		   const char* method_name,
		   const char* statistic_name,
		   const data_set<Ty,Tx>& ds,
		   const char* froze_parameters
		   )
  {
    fitter<Ty,Tx,Tp,Ts,Tstr> fit;
    fit.load_data(ds);
    const statistic<Ty,Tx,Tp,Ts,Tstr>* pstat=get_statistic<Ty,Tx,Tp,Ts,Tstr>(statistic_name);
    fit.set_statistic(*pstat);
    const opt_method<Ts,Tp>* popm=get_opt_method<Ty,Tp>(method_name);
    fit.set_opt_method(*popm);
    const model<Ty,Tx,Tp,Tstr>* pmo=get_model<Ty,Tx,Tp,Tstr>(model_name);
    fit.set_model(*pmo);
    fit.fit();
  }


}

#endif