Ignore:
Timestamp:
07/30/07 11:59:36 (17 years ago)
Author:
Malte Marquarding
Message:

merge from alma branch to get alma/GBT support. Commented out fluxUnit changes as they are using a chnaged interface to PKSreader/writer. Also commented out progress meter related code.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/STFitter.cpp

    r1232 r1391  
    329329}
    330330
     331bool Fitter::lfit() {
     332  LinearFit<Float> fitter;
     333  CompoundFunction<Float> func;
     334
     335  uInt n = funcs_.nelements();
     336  for (uInt i=0; i<n; ++i) {
     337    func.addFunction(*funcs_[i]);
     338  }
     339
     340  fitter.setFunction(func);
     341  //fitter.setMaxIter(50+n*10);
     342  // Convergence criterium
     343  //fitter.setCriteria(0.001);
     344
     345  // Fit
     346  Vector<Float> sigma(x_.nelements());
     347  sigma = 1.0;
     348
     349  parameters_.resize();
     350  parameters_ = fitter.fit(x_, y_, sigma, &m_);
     351  std::vector<float> ps;
     352  parameters_.tovector(ps);
     353  setParameters(ps);
     354
     355  error_.resize();
     356  error_ = fitter.errors();
     357
     358  chisquared_ = fitter.getChi2();
     359
     360  residual_.resize();
     361  residual_ =  y_;
     362  fitter.residual(residual_,x_);
     363  // use fitter.residual(model=True) to get the model
     364  thefit_.resize(x_.nelements());
     365  fitter.residual(thefit_,x_,True);
     366  return true;
     367}
    331368
    332369std::vector<float> Fitter::evaluate(int whichComp) const
Note: See TracChangeset for help on using the changeset viewer.