22 #ifndef UNFIT_EXAMPLES_GAUSSIANEQUATION_HPP_ 23 #define UNFIT_EXAMPLES_GAUSSIANEQUATION_HPP_ 27 #include "GenericCostFunction.hpp" 61 const std::vector<double> &data_y)
79 std::vector<double>
operator()(
const std::vector<double> ¶m)
82 for (
auto i = 0u; i < residuals.size(); ++i) {
83 residuals[i] -= param[0] * exp(-(
data_x_[i] - param[1]) * (
data_x_[i] -
84 param[1]) / (2.0*param[2]*param[2])) + param[3];
Fit a four parameter Gaussian curve to some data.
Definition: GaussianEquation.hpp:45
Definition: Bounds.hpp:27
std::vector< double > operator()(const std::vector< double > ¶m)
Definition: GaussianEquation.hpp:79
GaussianEquation(const std::vector< double > &data_x, const std::vector< double > &data_y)
Definition: GaussianEquation.hpp:60
Definition: GenericCostFunction.hpp:36
const std::vector< double > data_x_
Definition: GaussianEquation.hpp:90
const std::vector< double > data_y_
Definition: GaussianEquation.hpp:92