#include <Fit.h>
Public Types | |
enum | Algorithm { ScaledLevenbergMarquardt, UnscaledLevenbergMarquardt, NelderMeadSimplex } |
typedef int(* | fit_function )(const gsl_vector *, void *, gsl_vector *) |
typedef int(* | fit_function_df )(const gsl_vector *, void *, gsl_matrix *) |
typedef int(* | fit_function_fdf )(const gsl_vector *, void *, gsl_vector *, gsl_matrix *) |
typedef double(* | fit_function_simplex )(const gsl_vector *, void *) |
enum | FitType { BuiltIn = 0, Plugin = 1, User = 2 } |
enum | WeightingMethod { NoWeighting, Instrumental, Statistical, Dataset } |
Public Member Functions | |
double | adjustedRSquare () |
Returns adjusted R^2. | |
double | chiSquare () |
Returns the sum of squares of the residuals from the best-fit line. | |
Matrix * | covarianceMatrix (const QString &matrixName) |
double * | errors () |
Returns a vector with the standard deviations of the results. | |
virtual double | eval (double *, double) |
Calculates the data for the output fit curve. | |
QString | fileName () |
virtual void | fit () |
Actually does the fit. Should be reimplemented in derived classes. | |
Fit (ApplicationWindow *parent, Table *t, const QString &name=QString()) | |
Fit (ApplicationWindow *parent, Graph *g=0, const QString &name=QString()) | |
QString | formula () |
void | freeMemory () |
Frees the memory allocated for the X and Y data sets. | |
void | generateFunction (bool yes, int points=100) |
Specifies weather the result of the fit is a function curve. | |
virtual void | guessInitialValues () |
double | initialGuess (int parIndex) |
double | lcl (int parIndex, double confidenceLevel) |
Lower Confidence Limit. | |
virtual QString | legendInfo () |
Output string added to the plot as a new legend. | |
bool | load (const QString &fileName) |
int | numParameters () |
QStringList | parameterNames () |
Table * | parametersTable (const QString &tableName) |
double * | residuals () |
Returns a vector with the fit residuals. | |
QString | resultFormula () |
double * | results () |
Returns a vector with the fit results. | |
double | rmse () |
Returns the Root Mean Squared Error. | |
double | rSquare () |
Returns R^2. | |
double | rss () |
Returns the Residual Sum of Squares. | |
virtual bool | run () |
Actually does the job. Should be reimplemented in derived classes. | |
bool | save (const QString &fileName) |
void | scaleErrors (bool yes=true) |
Specifies wheather the errors must be scaled with sqrt(chi_2/dof). | |
void | setAlgorithm (Algorithm s) |
void | setDataCurve (int curve, double start, double end) |
bool | setDataFromTable (Table *t, const QString &xColName, const QString &yColName, int from=1, int to=-1) |
void | setFileName (const QString &fn) |
virtual void | setFormula (const QString &) |
void | setInitialGuess (int parIndex, double val) |
void | setInitialGuesses (double *x_init) |
void | setParameterExplanations (const QStringList &lst) |
void | setParameterRange (int parIndex, double left, double right) |
virtual void | setParametersList (const QStringList &) |
void | setType (FitType t) |
bool | setWeightingData (WeightingMethod w, const QString &colName=QString::null) |
Sets the data set to be used for weighting. | |
void | showConfidenceLimits (double confidenceLevel) |
void | showPredictionLimits (double confidenceLevel) |
QwtPlotCurve * | showResiduals () |
Plot residuals and display data values in a column. | |
FitType | type () |
double | ucl (int parIndex, double confidenceLevel) |
Upper Confidence Limit. | |
void | writeParametersToTable (Table *t, bool append=false) |
~Fit () | |
Protected Member Functions | |
virtual void | calculateFitCurveData (double *X, double *Y) |
Calculates the data for the output fit curve and store itin the X an Y vectors. | |
void | freeWorkspace () |
Frees the memory allocated for the fit workspace. | |
virtual void | generateFitCurve () |
Adds the result curve to the plot. | |
void | initWorkspace (int par) |
Allocates the memory for the fit workspace. | |
void | insertFitFunctionCurve (const QString &name, double *x, double *y, int penWidth=1) |
Adds the result curve as a FunctionCurve to the plot, if d_gen_function = true. | |
virtual QString | logFitInfo (int iterations, int status) |
Output string added to the result log. | |
Protected Attributes | |
double | chi_2 |
The sum of squares of the residuals from the best-fit line. | |
gsl_matrix * | covar |
Covariance matrix. | |
double | d_adjusted_r_square |
Adjusted R^2. | |
Matrix * | d_cov_matrix |
Matrix window used for the output of covariance matrix. | |
fit_function_df | d_df |
double * | d_errors |
Stores standard deviations of the result parameters. | |
fit_function | d_f |
fit_function_fdf | d_fdf |
QString | d_file_name |
Path of the XML file where the user stores the fit model. | |
FitType | d_fit_type |
QString | d_formula |
The fit formula given on input. | |
fit_function_simplex | d_fsimplex |
bool | d_gen_function |
Specifies weather the result curve is a FunctionCurve or a normal curve with the same x values as the fit data. | |
int | d_p |
Number of fit parameters. | |
QStringList | d_param_explain |
Stores a list of short explanations for the significance of the fit parameters. | |
gsl_vector * | d_param_init |
Initial guesses for the fit parameters. | |
QStringList | d_param_names |
Names of the fit parameters. | |
double * | d_param_range_left |
Stores the left limits of the research interval for the result parameters. | |
double * | d_param_range_right |
Stores the right limits of the research interval for the result parameters. | |
Table * | d_param_table |
Table window used for the output of fit parameters. | |
double * | d_residuals |
Stores fit residuals. | |
QString | d_result_formula |
The result fit formula, where the fit parameters are replaced with the calculated values. | |
double * | d_results |
Stores the result parameters. | |
double | d_rss |
Residual sum of squares. | |
bool | d_scale_errors |
Specifies wheather the errors must be scaled with sqrt(chi_2/dof). | |
Algorithm | d_solver |
Algorithm type. | |
double * | d_w |
weighting data set used for the fit | |
WeightingMethod | d_weighting |
The kind of weighting to be performed on the data. | |
bool | is_non_linear |
Tells whether the fitter uses non-linear/simplex fitting with an initial parameters set, that must be freed in the destructor. | |
QString | weighting_dataset |
The name of the weighting dataset. | |
Private Member Functions | |
virtual void | customizeFitResults () |
Customs and stores the fit results according to the derived class specifications. Used by exponential fits. | |
gsl_multifit_fdfsolver * | fitGSL (gsl_multifit_function_fdf f, int &iterations, int &status) |
Pointer to the GSL multifit solver. | |
gsl_multimin_fminimizer * | fitSimplex (gsl_multimin_function f, int &iterations, int &status) |
Pointer to the GSL multifit minimizer (for simplex algorithm). | |
void | init () |
typedef int(* Fit::fit_function)(const gsl_vector *, void *, gsl_vector *) |
typedef int(* Fit::fit_function_df)(const gsl_vector *, void *, gsl_matrix *) |
typedef int(* Fit::fit_function_fdf)(const gsl_vector *, void *, gsl_vector *, gsl_matrix *) |
typedef double(* Fit::fit_function_simplex)(const gsl_vector *, void *) |
enum Fit::Algorithm |
enum Fit::FitType |
enum Fit::WeightingMethod |
Fit::Fit | ( | ApplicationWindow * | parent, | |
Graph * | g = 0 , |
|||
const QString & | name = QString() | |||
) |
References init().
Fit::Fit | ( | ApplicationWindow * | parent, | |
Table * | t, | |||
const QString & | name = QString() | |||
) |
References init().
Fit::~Fit | ( | ) |
References d_p, d_residuals, and freeWorkspace().
double Fit::adjustedRSquare | ( | ) | [inline] |
virtual void Fit::calculateFitCurveData | ( | double * | X, | |
double * | Y | |||
) | [inline, protected, virtual] |
Calculates the data for the output fit curve and store itin the X an Y vectors.
Reimplemented in ExponentialFit, TwoExpFit, ThreeExpFit, LogisticFit, GaussAmpFit, NonLinearFit, PluginFit, PolynomialFit, LinearFit, LinearSlopeFit, and SigmoidalFit.
Referenced by generateFitCurve().
double Fit::chiSquare | ( | ) | [inline] |
Returns the sum of squares of the residuals from the best-fit line.
References chi_2.
Referenced by ApplicationWindow::fitLinear().
Matrix * Fit::covarianceMatrix | ( | const QString & | matrixName | ) |
virtual void Fit::customizeFitResults | ( | ) | [inline, private, virtual] |
Customs and stores the fit results according to the derived class specifications. Used by exponential fits.
Reimplemented in ExponentialFit, TwoExpFit, ThreeExpFit, and MultiPeakFit.
Referenced by generateFitCurve().
double * Fit::errors | ( | ) |
Returns a vector with the standard deviations of the results.
References chi_2, covar, d_errors, Filter::d_n, d_p, and d_scale_errors.
virtual double Fit::eval | ( | double * | , | |
double | ||||
) | [inline, virtual] |
Calculates the data for the output fit curve.
Reimplemented in ExponentialFit, TwoExpFit, ThreeExpFit, LogisticFit, MultiPeakFit, GaussAmpFit, NonLinearFit, PluginFit, PolynomialFit, LinearFit, LinearSlopeFit, and SigmoidalFit.
Referenced by residuals(), rSquare(), showConfidenceLimits(), showPredictionLimits(), and FitDialog::updatePreview().
QString Fit::fileName | ( | ) | [inline] |
References d_file_name.
Referenced by FitDialog::loadUserFunctions(), FitDialog::removeUserFunction(), FitDialog::saveInitialGuesses(), and FitDialog::saveUserFunction().
void Fit::fit | ( | ) | [virtual] |
Actually does the fit. Should be reimplemented in derived classes.
Reimplemented in PolynomialFit, LinearFit, and LinearSlopeFit.
References chi_2, covar, d_df, d_f, d_fdf, d_formula, d_fsimplex, Filter::d_graph, Filter::d_init_err, Filter::d_max_iterations, Filter::d_n, d_p, d_param_names, d_solver, Filter::d_table, d_w, Filter::d_x, Filter::d_y, fitGSL(), fitSimplex(), generateFitCurve(), logFitInfo(), NelderMeadSimplex, ApplicationWindow::updateLog(), and ApplicationWindow::writeFitResultsToLog.
Referenced by FitDialog::accept(), ApplicationWindow::analyzeCurve(), MultiPeakFitTool::finalize(), ExpDecayDialog::fit(), and run().
gsl_multifit_fdfsolver * Fit::fitGSL | ( | gsl_multifit_function_fdf | f, | |
int & | iterations, | |||
int & | status | |||
) | [private] |
Pointer to the GSL multifit solver.
References covar, Filter::d_max_iterations, Filter::d_n, d_p, d_param_init, d_param_range_left, d_param_range_right, d_results, d_solver, and Filter::d_tolerance.
Referenced by fit().
gsl_multimin_fminimizer * Fit::fitSimplex | ( | gsl_multimin_function | f, | |
int & | iterations, | |||
int & | status | |||
) | [private] |
Pointer to the GSL multifit minimizer (for simplex algorithm).
References Filter::d_max_iterations, d_p, d_param_init, d_param_range_left, d_param_range_right, d_results, and Filter::d_tolerance.
Referenced by fit().
QString Fit::formula | ( | ) | [inline] |
void Fit::freeMemory | ( | ) |
Frees the memory allocated for the X and Y data sets.
References d_p, Filter::d_x, and Filter::d_y.
Referenced by FitDialog::showEditPage().
void Fit::freeWorkspace | ( | ) | [protected] |
Frees the memory allocated for the fit workspace.
References covar, d_errors, d_param_init, d_param_range_left, d_param_range_right, and d_results.
Referenced by MultiPeakFit::setNumPeaks(), PolynomialFit::setOrder(), NonLinearFit::setParametersList(), and ~Fit().
void Fit::generateFitCurve | ( | ) | [protected, virtual] |
Adds the result curve to the plot.
Reimplemented in MultiPeakFit.
References MultiLayer::activeLayer(), Graph::addFitCurve(), Filter::addResultCurve(), calculateFitCurveData(), Filter::createOutputGraph(), customizeFitResults(), d_gen_function, Filter::d_graphics_display, Filter::d_n, Filter::d_output_graph, Filter::d_points, insertFitFunctionCurve(), FitData::X, and FitData::Y.
Referenced by LinearSlopeFit::fit(), LinearFit::fit(), PolynomialFit::fit(), and fit().
void Fit::generateFunction | ( | bool | yes, | |
int | points = 100 | |||
) |
Specifies weather the result of the fit is a function curve.
References d_gen_function, and Filter::d_points.
Referenced by FitDialog::accept(), ApplicationWindow::analyzeCurve(), PolynomFitDialog::fit(), ExpDecayDialog::fit(), ApplicationWindow::fitLinear(), and MultiPeakFitTool::MultiPeakFitTool().
virtual void Fit::guessInitialValues | ( | ) | [inline, virtual] |
Reimplemented in LogisticFit, MultiPeakFit, GaussAmpFit, and SigmoidalFit.
Referenced by ApplicationWindow::analyzeCurve().
void Fit::init | ( | ) | [private] |
Reimplemented from Filter.
Reimplemented in ExponentialFit, TwoExpFit, ThreeExpFit, LogisticFit, LorentzFit, GaussFit, GaussAmpFit, NonLinearFit, PluginFit, PolynomialFit, LinearFit, LinearSlopeFit, and SigmoidalFit.
References BuiltIn, chi_2, covar, d_adjusted_r_square, d_cov_matrix, Filter::d_curve, Filter::d_curveColorIndex, d_errors, Filter::d_explanation, d_fit_type, d_formula, d_gen_function, Filter::d_init_err, Filter::d_max_iterations, Filter::d_n, d_p, d_param_init, d_param_range_left, d_param_range_right, d_param_table, Filter::d_points, Filter::d_prec, d_residuals, d_result_formula, d_results, d_rss, d_scale_errors, d_solver, Filter::d_sort_data, Filter::d_tolerance, d_weighting, Filter::d_x, Filter::d_y, is_non_linear, NoWeighting, ScaledLevenbergMarquardt, and weighting_dataset.
Referenced by Fit(), and MultiPeakFit::MultiPeakFit().
double Fit::initialGuess | ( | int | parIndex | ) | [inline] |
References d_param_init.
Referenced by MultiPeakFitTool::finalize(), FitDialog::loadUserFunctions(), and FitDialog::showFitPage().
void Fit::initWorkspace | ( | int | par | ) | [protected] |
Allocates the memory for the fit workspace.
References covar, Filter::d_min_points, d_param_init, d_param_range_left, d_param_range_right, and d_results.
Referenced by SigmoidalFit::init(), GaussAmpFit::init(), LogisticFit::init(), ThreeExpFit::init(), TwoExpFit::init(), ExponentialFit::init(), PluginFit::load(), MultiPeakFit::setNumPeaks(), PolynomialFit::setOrder(), and NonLinearFit::setParametersList().
void Fit::insertFitFunctionCurve | ( | const QString & | name, | |
double * | x, | |||
double * | y, | |||
int | penWidth = 1 | |||
) | [protected] |
Adds the result curve as a FunctionCurve to the plot, if d_gen_function = true.
References Graph::addFitCurve(), ColorBox::color(), Filter::d_curveColorIndex, d_formula, Filter::d_n, Filter::d_output_graph, d_p, d_param_names, Filter::d_points, Filter::d_prec, d_result_formula, d_results, Filter::d_x, formula(), Graph::generateFunctionName(), Graph::insertPlotItem(), Graph::Line, FunctionCurve::Normal, FunctionCurve::setFormula(), and FunctionCurve::setRange().
Referenced by MultiPeakFit::generateFitCurve(), and generateFitCurve().
double Fit::lcl | ( | int | parIndex, | |
double | confidenceLevel | |||
) |
Lower Confidence Limit.
References covar, Filter::d_n, d_p, and d_results.
Referenced by showConfidenceLimits(), and showPredictionLimits().
QString Fit::legendInfo | ( | ) | [virtual] |
Output string added to the plot as a new legend.
Reimplemented from Filter.
Reimplemented in PolynomialFit.
References chi_2, covar, Filter::d_curve, d_formula, Filter::d_n, d_p, d_param_names, Filter::d_prec, d_results, d_scale_errors, Filter::d_y_col_name, ApplicationWindow::locale(), and rSquare().
bool Fit::load | ( | const QString & | fileName | ) |
QString Fit::logFitInfo | ( | int | iterations, | |
int | status | |||
) | [protected, virtual] |
Output string added to the result log.
Reimplemented in MultiPeakFit.
References chi_2, covar, d_adjusted_r_square, Filter::d_curve, Filter::d_explanation, d_formula, Filter::d_graphics_display, Filter::d_n, Filter::d_output_graph, d_p, d_param_explain, d_param_names, Filter::d_prec, d_results, d_rss, d_scale_errors, d_solver, Filter::d_tolerance, d_weighting, Filter::d_x, Filter::d_y_col_name, Dataset, Instrumental, is_non_linear, ApplicationWindow::locale(), Graph::multiLayer(), NelderMeadSimplex, NoWeighting, rSquare(), Statistical, UnscaledLevenbergMarquardt, and weighting_dataset.
Referenced by LinearSlopeFit::fit(), LinearFit::fit(), PolynomialFit::fit(), fit(), and MultiPeakFit::logFitInfo().
int Fit::numParameters | ( | ) | [inline] |
QStringList Fit::parameterNames | ( | ) | [inline] |
Table * Fit::parametersTable | ( | const QString & | tableName | ) |
References d_p, d_param_table, ApplicationWindow::generateUniqueName(), ApplicationWindow::newTable(), Table::setColPlotDesignation(), Table::setHeader(), Table::setHeaderColType(), ApplicationWindow::table(), writeParametersToTable(), and Table::yErr.
Referenced by FitDialog::showParametersTable().
double * Fit::residuals | ( | ) |
Returns a vector with the fit residuals.
References Filter::d_n, d_residuals, d_results, Filter::d_x, Filter::d_y, Filter::error(), and eval().
QString Fit::resultFormula | ( | ) | [inline] |
References d_result_formula.
double* Fit::results | ( | ) | [inline] |
Returns a vector with the fit results.
References d_results.
Referenced by FitDialog::accept(), ExpDecayDialog::fit(), and ApplicationWindow::fitLinear().
double Fit::rmse | ( | ) | [inline] |
double Fit::rSquare | ( | ) |
Returns R^2.
References d_adjusted_r_square, Filter::d_n, d_p, d_residuals, d_results, d_rss, d_w, Filter::d_x, Filter::d_y, eval(), and Filter::y().
Referenced by ApplicationWindow::fitLinear(), legendInfo(), and logFitInfo().
double Fit::rss | ( | ) | [inline] |
virtual bool Fit::run | ( | ) | [inline, virtual] |
bool Fit::save | ( | const QString & | fileName | ) |
References d_file_name, d_fit_type, d_formula, d_p, d_param_explain, d_param_init, d_param_names, and FitData::function.
Referenced by ApplicationWindow::saveFitFunctions(), FitDialog::saveInitialGuesses(), and FitDialog::saveUserFunction().
void Fit::scaleErrors | ( | bool | yes = true |
) | [inline] |
Specifies wheather the errors must be scaled with sqrt(chi_2/dof).
References d_scale_errors.
Referenced by FitDialog::accept(), ApplicationWindow::analyzeCurve(), and ExpDecayDialog::fit().
void Fit::setAlgorithm | ( | Algorithm | s | ) | [inline] |
void Fit::setDataCurve | ( | int | curve, | |
double | start, | |||
double | end | |||
) | [virtual] |
Reimplemented from Filter.
References Filter::d_curve, Filter::d_graph, Filter::d_n, d_w, d_weighting, QwtErrorPlotCurve::errorValue(), Graph::Function, Instrumental, Filter::setDataCurve(), type(), weighting_dataset, and QwtErrorPlotCurve::xErrors().
bool Fit::setDataFromTable | ( | Table * | t, | |
const QString & | xColName, | |||
const QString & | yColName, | |||
int | from = 1 , |
|||
int | to = -1 | |||
) | [virtual] |
Reimplemented from Filter.
References Filter::d_n, d_w, and Filter::setDataFromTable().
Referenced by ExponentialFit::ExponentialFit(), GaussAmpFit::GaussAmpFit(), GaussFit::GaussFit(), LinearFit::LinearFit(), LinearSlopeFit::LinearSlopeFit(), LogisticFit::LogisticFit(), LorentzFit::LorentzFit(), NonLinearFit::NonLinearFit(), PluginFit::PluginFit(), PolynomialFit::PolynomialFit(), SigmoidalFit::SigmoidalFit(), ThreeExpFit::ThreeExpFit(), and TwoExpFit::TwoExpFit().
void Fit::setFileName | ( | const QString & | fn | ) | [inline] |
References d_file_name.
Referenced by FitDialog::chooseFolder(), FitDialog::initBuiltInFunctions(), FitDialog::loadPlugins(), and FitDialog::loadUserFunctions().
virtual void Fit::setFormula | ( | const QString & | ) | [inline, virtual] |
Reimplemented in NonLinearFit.
Referenced by FitDialog::accept(), FitModelHandler::endElement(), FitDialog::saveUserFunction(), and FitDialog::showFitPage().
void Fit::setInitialGuess | ( | int | parIndex, | |
double | val | |||
) | [inline] |
References d_param_init.
Referenced by MultiPeakFitTool::finalize(), FitDialog::loadUserFunctions(), FitDialog::saveInitialGuesses(), and MultiPeakFitTool::selectPeak().
void Fit::setInitialGuesses | ( | double * | x_init | ) |
References d_p, and d_param_init.
Referenced by FitDialog::accept(), FitModelHandler::endElement(), and ExpDecayDialog::fit().
void Fit::setParameterExplanations | ( | const QStringList & | lst | ) | [inline] |
void Fit::setParameterRange | ( | int | parIndex, | |
double | left, | |||
double | right | |||
) |
virtual void Fit::setParametersList | ( | const QStringList & | ) | [inline, virtual] |
Reimplemented in NonLinearFit.
Referenced by FitDialog::accept(), FitModelHandler::endElement(), FitDialog::saveUserFunction(), and FitDialog::showFitPage().
void Fit::setType | ( | FitType | t | ) | [inline] |
bool Fit::setWeightingData | ( | WeightingMethod | w, | |
const QString & | colName = QString::null | |||
) |
Sets the data set to be used for weighting.
References Table::cell(), Table::colIndex(), Filter::d_curve, Filter::d_graph, Filter::d_n, Filter::d_table, d_w, d_weighting, Filter::d_y, Filter::d_y_col_name, Dataset, Filter::error(), QwtErrorPlotCurve::errorValue(), Graph::Function, Instrumental, NoWeighting, Table::numRows(), Statistical, type(), weighting_dataset, and QwtErrorPlotCurve::xErrors().
Referenced by FitDialog::accept().
void Fit::showConfidenceLimits | ( | double | confidenceLevel | ) |
References MultiLayer::activeLayer(), ColorBox::color(), Filter::createOutputGraph(), Filter::d_curveColorIndex, Filter::d_explanation, Filter::d_graphics_display, Filter::d_n, Filter::d_output_graph, d_p, d_results, d_rss, Filter::d_x, eval(), ApplicationWindow::generateUniqueName(), ApplicationWindow::hideWindow(), Graph::insertPlotItem(), lcl(), Graph::Line, ApplicationWindow::newTable(), Table::numCols(), Table::setCell(), Table::setColComment(), Table::setColName(), Table::table(), ucl(), Graph::updatePlot(), Filter::x(), and Filter::y().
Referenced by FitDialog::showConfidenceLimits().
void Fit::showPredictionLimits | ( | double | confidenceLevel | ) |
References MultiLayer::activeLayer(), ColorBox::color(), Filter::createOutputGraph(), Filter::d_curveColorIndex, Filter::d_explanation, Filter::d_graphics_display, Filter::d_n, Filter::d_output_graph, d_p, d_results, d_rss, Filter::d_x, eval(), ApplicationWindow::generateUniqueName(), ApplicationWindow::hideWindow(), Graph::insertPlotItem(), lcl(), Graph::Line, ApplicationWindow::newTable(), Table::numCols(), Table::setCell(), Table::setColComment(), Table::setColName(), Table::table(), ucl(), Graph::updatePlot(), Filter::x(), and Filter::y().
Referenced by FitDialog::showPredictionLimits().
QwtPlotCurve * Fit::showResiduals | ( | ) |
Plot residuals and display data values in a column.
References MultiLayer::activeLayer(), ColorBox::color(), Filter::createOutputGraph(), Filter::d_curveColorIndex, Filter::d_explanation, Filter::d_graphics_display, Filter::d_n, Filter::d_output_graph, d_residuals, Filter::d_x, ApplicationWindow::generateUniqueName(), ApplicationWindow::hideWindow(), Graph::insertPlotItem(), Graph::Line, ApplicationWindow::newTable(), Table::numCols(), Table::setCell(), Table::setColName(), Table::table(), and Graph::updatePlot().
Referenced by FitDialog::showResiduals().
FitType Fit::type | ( | ) | [inline] |
References d_fit_type.
Referenced by FitDialog::accept(), FitDialog::loadUserFunctions(), setDataCurve(), setWeightingData(), FitDialog::showFitPage(), and FitDialog::updatePreview().
double Fit::ucl | ( | int | parIndex, | |
double | confidenceLevel | |||
) |
Upper Confidence Limit.
References covar, Filter::d_n, d_p, and d_results.
Referenced by showConfidenceLimits(), and showPredictionLimits().
void Fit::writeParametersToTable | ( | Table * | t, | |
bool | append = false | |||
) |
References covar, d_p, d_param_names, Filter::d_prec, d_results, ApplicationWindow::locale(), Table::numCols(), Table::numRows(), Table::setNumCols(), Table::setNumRows(), Table::setText(), and Table::table().
Referenced by FitDialog::accept(), and parametersTable().
double Fit::chi_2 [protected] |
The sum of squares of the residuals from the best-fit line.
Referenced by chiSquare(), errors(), LinearSlopeFit::fit(), LinearFit::fit(), PolynomialFit::fit(), fit(), init(), legendInfo(), and logFitInfo().
gsl_matrix* Fit::covar [protected] |
Covariance matrix.
Referenced by covarianceMatrix(), errors(), LinearSlopeFit::fit(), LinearFit::fit(), PolynomialFit::fit(), fit(), fitGSL(), freeWorkspace(), LinearSlopeFit::init(), LinearFit::init(), MultiPeakFit::init(), init(), initWorkspace(), lcl(), legendInfo(), logFitInfo(), ucl(), and writeParametersToTable().
double Fit::d_adjusted_r_square [protected] |
Matrix* Fit::d_cov_matrix [protected] |
Matrix window used for the output of covariance matrix.
Referenced by covarianceMatrix(), and init().
fit_function_df Fit::d_df [protected] |
double* Fit::d_errors [protected] |
Stores standard deviations of the result parameters.
Referenced by errors(), freeWorkspace(), and init().
fit_function Fit::d_f [protected] |
fit_function_fdf Fit::d_fdf [protected] |
QString Fit::d_file_name [protected] |
Path of the XML file where the user stores the fit model.
Referenced by fileName(), load(), save(), and setFileName().
FitType Fit::d_fit_type [protected] |
Referenced by PluginFit::init(), NonLinearFit::init(), init(), save(), setType(), and type().
QString Fit::d_formula [protected] |
The fit formula given on input.
Referenced by NonLinearFit::calculateFitCurveData(), NonLinearFit::eval(), fit(), formula(), SigmoidalFit::init(), LinearSlopeFit::init(), LinearFit::init(), NonLinearFit::init(), GaussAmpFit::init(), LogisticFit::init(), init(), ThreeExpFit::init(), TwoExpFit::init(), ExponentialFit::init(), insertFitFunctionCurve(), legendInfo(), PluginFit::load(), logFitInfo(), save(), NonLinearFit::setFormula(), MultiPeakFit::setNumPeaks(), and PolynomialFit::setOrder().
fit_function_simplex Fit::d_fsimplex [protected] |
bool Fit::d_gen_function [protected] |
Specifies weather the result curve is a FunctionCurve or a normal curve with the same x values as the fit data.
Referenced by SigmoidalFit::calculateFitCurveData(), LinearSlopeFit::calculateFitCurveData(), LinearFit::calculateFitCurveData(), PolynomialFit::calculateFitCurveData(), PluginFit::calculateFitCurveData(), NonLinearFit::calculateFitCurveData(), GaussAmpFit::calculateFitCurveData(), LogisticFit::calculateFitCurveData(), ThreeExpFit::calculateFitCurveData(), TwoExpFit::calculateFitCurveData(), ExponentialFit::calculateFitCurveData(), MultiPeakFit::generateFitCurve(), generateFitCurve(), generateFunction(), and init().
int Fit::d_p [protected] |
Number of fit parameters.
Referenced by PolynomialFit::calculateFitCurveData(), NonLinearFit::calculateFitCurveData(), covarianceMatrix(), errors(), PolynomialFit::eval(), NonLinearFit::eval(), MultiPeakFit::eval(), LinearSlopeFit::fit(), LinearFit::fit(), PolynomialFit::fit(), fit(), fitGSL(), fitSimplex(), freeMemory(), MultiPeakFit::generateFitCurve(), SigmoidalFit::init(), LinearSlopeFit::init(), LinearFit::init(), GaussAmpFit::init(), LogisticFit::init(), init(), ThreeExpFit::init(), TwoExpFit::init(), ExponentialFit::init(), insertFitFunctionCurve(), MultiPeakFit::insertPeakFunctionCurve(), lcl(), PolynomialFit::legendInfo(), legendInfo(), PluginFit::load(), logFitInfo(), numParameters(), parametersTable(), rmse(), rSquare(), save(), NonLinearFit::setFormula(), setInitialGuesses(), MultiPeakFit::setNumPeaks(), PolynomialFit::setOrder(), setParameterRange(), NonLinearFit::setParametersList(), showConfidenceLimits(), showPredictionLimits(), ucl(), writeParametersToTable(), and ~Fit().
QStringList Fit::d_param_explain [protected] |
Stores a list of short explanations for the significance of the fit parameters.
Referenced by SigmoidalFit::init(), LinearSlopeFit::init(), LinearFit::init(), GaussAmpFit::init(), GaussFit::init(), LorentzFit::init(), LogisticFit::init(), ThreeExpFit::init(), TwoExpFit::init(), ExponentialFit::init(), PluginFit::load(), logFitInfo(), save(), MultiPeakFit::setNumPeaks(), PolynomialFit::setOrder(), setParameterExplanations(), and NonLinearFit::setParametersList().
gsl_vector* Fit::d_param_init [protected] |
Initial guesses for the fit parameters.
Referenced by PolynomialFit::fit(), fitGSL(), fitSimplex(), freeWorkspace(), SigmoidalFit::guessInitialValues(), GaussAmpFit::guessInitialValues(), MultiPeakFit::guessInitialValues(), LogisticFit::guessInitialValues(), LinearSlopeFit::init(), LinearFit::init(), MultiPeakFit::init(), init(), initialGuess(), initWorkspace(), save(), NonLinearFit::setFormula(), setInitialGuess(), and setInitialGuesses().
QStringList Fit::d_param_names [protected] |
Names of the fit parameters.
Referenced by NonLinearFit::calculateFitCurveData(), NonLinearFit::eval(), fit(), SigmoidalFit::init(), LinearSlopeFit::init(), LinearFit::init(), GaussAmpFit::init(), LogisticFit::init(), ThreeExpFit::init(), TwoExpFit::init(), ExponentialFit::init(), insertFitFunctionCurve(), MultiPeakFit::insertPeakFunctionCurve(), legendInfo(), PluginFit::load(), logFitInfo(), parameterNames(), save(), NonLinearFit::setFormula(), MultiPeakFit::setNumPeaks(), PolynomialFit::setOrder(), NonLinearFit::setParametersList(), and writeParametersToTable().
double* Fit::d_param_range_left [protected] |
Stores the left limits of the research interval for the result parameters.
Referenced by fitGSL(), fitSimplex(), freeWorkspace(), init(), initWorkspace(), and setParameterRange().
double* Fit::d_param_range_right [protected] |
Stores the right limits of the research interval for the result parameters.
Referenced by fitGSL(), fitSimplex(), freeWorkspace(), init(), initWorkspace(), and setParameterRange().
Table* Fit::d_param_table [protected] |
double* Fit::d_residuals [protected] |
QString Fit::d_result_formula [protected] |
The result fit formula, where the fit parameters are replaced with the calculated values.
Referenced by init(), insertFitFunctionCurve(), and resultFormula().
double* Fit::d_results [protected] |
Stores the result parameters.
Referenced by SigmoidalFit::calculateFitCurveData(), LinearSlopeFit::calculateFitCurveData(), LinearFit::calculateFitCurveData(), PolynomialFit::calculateFitCurveData(), PluginFit::calculateFitCurveData(), NonLinearFit::calculateFitCurveData(), GaussAmpFit::calculateFitCurveData(), LogisticFit::calculateFitCurveData(), ThreeExpFit::calculateFitCurveData(), TwoExpFit::calculateFitCurveData(), ExponentialFit::calculateFitCurveData(), MultiPeakFit::customizeFitResults(), ThreeExpFit::customizeFitResults(), TwoExpFit::customizeFitResults(), ExponentialFit::customizeFitResults(), LinearSlopeFit::fit(), LinearFit::fit(), PolynomialFit::fit(), fitGSL(), fitSimplex(), freeWorkspace(), MultiPeakFit::generateFitCurve(), LinearSlopeFit::init(), LinearFit::init(), MultiPeakFit::init(), init(), initWorkspace(), insertFitFunctionCurve(), MultiPeakFit::insertPeakFunctionCurve(), lcl(), PolynomialFit::legendInfo(), legendInfo(), MultiPeakFit::logFitInfo(), logFitInfo(), residuals(), results(), rSquare(), showConfidenceLimits(), showPredictionLimits(), ucl(), and writeParametersToTable().
double Fit::d_rss [protected] |
Residual sum of squares.
Referenced by init(), logFitInfo(), rmse(), rSquare(), rss(), showConfidenceLimits(), and showPredictionLimits().
bool Fit::d_scale_errors [protected] |
Specifies wheather the errors must be scaled with sqrt(chi_2/dof).
Referenced by errors(), LinearSlopeFit::init(), LinearFit::init(), PolynomialFit::init(), init(), legendInfo(), logFitInfo(), and scaleErrors().
Algorithm Fit::d_solver [protected] |
double* Fit::d_w [protected] |
weighting data set used for the fit
Referenced by LinearSlopeFit::fit(), LinearFit::fit(), PolynomialFit::fit(), fit(), rSquare(), setDataCurve(), setDataFromTable(), and setWeightingData().
WeightingMethod Fit::d_weighting [protected] |
The kind of weighting to be performed on the data.
Referenced by LinearSlopeFit::fit(), LinearFit::fit(), PolynomialFit::fit(), init(), logFitInfo(), setDataCurve(), and setWeightingData().
bool Fit::is_non_linear [protected] |
Tells whether the fitter uses non-linear/simplex fitting with an initial parameters set, that must be freed in the destructor.
Referenced by LinearSlopeFit::init(), LinearFit::init(), PolynomialFit::init(), init(), and logFitInfo().
QString Fit::weighting_dataset [protected] |
The name of the weighting dataset.
Referenced by init(), logFitInfo(), setDataCurve(), and setWeightingData().