Changeset 750 for trunk/yat/regression
 Timestamp:
 Feb 17, 2007, 11:56:29 AM (14 years ago)
 Location:
 trunk/yat/regression
 Files:

 2 edited
Legend:
 Unmodified
 Added
 Removed

trunk/yat/regression/MultiDimensional.cc
r739 r750 23 23 24 24 #include "MultiDimensional.h" 25 #include "yat/utility/Exception.h" 25 26 #include "yat/utility/matrix.h" 26 27 #include "yat/utility/vector.h" … … 59 60 if (work_) 60 61 gsl_multifit_linear_free(work_); 61 work_=gsl_multifit_linear_alloc(x.rows(),fit_parameters_.size()); 62 gsl_multifit_linear(x.gsl_matrix_p(),y.gsl_vector_p(), 63 fit_parameters_.gsl_vector_p(), 64 covariance_.gsl_matrix_p(),&chisquare_,work_); 62 if (!(work_=gsl_multifit_linear_alloc(x.rows(),fit_parameters_.size()))) 63 throw utility::GSL_error("MultiDimensional::fit failed to allocate memory"); 64 65 int status = gsl_multifit_linear(x.gsl_matrix_p(), y.gsl_vector_p(), 66 fit_parameters_.gsl_vector_p(), 67 covariance_.gsl_matrix_p(), &chisquare_, 68 work_); 69 if (status) 70 throw utility::GSL_error(std::string("MultiDimensional::fit",status)); 71 65 72 s2_ = chisquare_/(x.rows()x.columns()); 66 73 } 
trunk/yat/regression/MultiDimensionalWeighted.cc
r741 r750 62 62 if (work_) 63 63 gsl_multifit_linear_free(work_); 64 work_=gsl_multifit_linear_alloc(x.rows(),fit_parameters_.size()); 65 gsl_multifit_wlinear(x.gsl_matrix_p(),w.gsl_vector_p(),y.gsl_vector_p(), 66 fit_parameters_.gsl_vector_p(), 67 covariance_.gsl_matrix_p(),&chisquare_,work_); 64 if (!(work_=gsl_multifit_linear_alloc(x.rows(),fit_parameters_.size()))) 65 throw utility::GSL_error("MultiDimensionalWeighted::fit failed to allocate memory"); 66 int status = gsl_multifit_wlinear(x.gsl_matrix_p(), w.gsl_vector_p(), 67 y.gsl_vector_p(), 68 fit_parameters_.gsl_vector_p(), 69 covariance_.gsl_matrix_p(), &chisquare_, 70 work_); 71 if (status) 72 throw utility::GSL_error(std::string("MultiDimensionalWeighted::fit", 73 status)); 68 74 69 75 statistics::AveragerWeighted aw;
Note: See TracChangeset
for help on using the changeset viewer.