QtiPlot
0.9.8.2
|
#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, Direct } |
Public Member Functions | |
double | adjustedRSquare () |
Returns adjusted R^2. More... | |
double | chiSquare () |
Returns the sum of squares of the residuals from the best-fit line. More... | |
Matrix * | covarianceMatrix (const QString &matrixName) |
double * | errors () |
Returns a vector with the standard deviations of the results. More... | |
virtual double | eval (double *, double) |
Calculates the data for the output fit curve. More... | |
QString | fileName () |
Fit (ApplicationWindow *parent, QwtPlotCurve *c) | |
Fit (ApplicationWindow *parent, Graph *g=0, const QString &name=QString()) | |
Fit (ApplicationWindow *parent, Table *t, const QString &name=QString()) | |
virtual void | fit () |
Actually does the fit. Should be reimplemented in derived classes. More... | |
QString | formula () |
void | generateFunction (bool yes, int points=100) |
Specifies weather the result of the fit is a function curve. More... | |
virtual void | guessInitialValues () |
double | initialGuess (int parIndex) |
double | lcl (int parIndex, double confidenceLevel) |
Lower Confidence Limit. More... | |
virtual QString | legendInfo () |
Output string added to the plot as a new legend. More... | |
bool | load (const QString &fileName) |
int | numParameters () |
QStringList | parameterNames () |
Table * | parametersTable (const QString &tableName) |
double * | residuals () |
Returns a vector with the fit residuals. More... | |
QString | resultFormula () |
double * | results () |
Returns a vector with the fit results. More... | |
double | rmse () |
Returns the Root Mean Squared Error. More... | |
double | rSquare () |
Returns R^2. More... | |
double | rss () |
Returns the Residual Sum of Squares. More... | |
virtual bool | run () |
Actually does the job. Should be reimplemented in derived classes. More... | |
bool | save (const QString &fileName) |
void | scaleErrors (bool yes=true) |
Specifies wheather the errors must be scaled with sqrt(chi_2/dof) More... | |
void | setAlgorithm (Algorithm s) |
void | setDataCurve (QwtPlotCurve *curve, double start, double end) |
bool | setDataFromTable (Table *t, const QString &xColName, const QString &yColName, int from=1, int to=-1, bool sort=false) |
void | setFileName (const QString &fn) |
virtual bool | setFormula (const QString &, bool=true) |
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 bool | 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. More... | |
void | showConfidenceLimits (double confidenceLevel) |
void | showPredictionLimits (double confidenceLevel) |
QwtPlotCurve * | showResiduals () |
Plot residuals and display data values in a column. More... | |
FitType | type () |
double | ucl (int parIndex, double confidenceLevel) |
Upper Confidence Limit. More... | |
void | writeParametersToTable (Table *t, bool append=false) |
~Fit () | |
![]() | |
int | dataSize () |
Returns the size of the input data set. More... | |
virtual void | enableGraphicsDisplay (bool on=true, Graph *g=0) |
bool | error () |
Filter (ApplicationWindow *parent, Table *t=0, const QString &name=QString()) | |
Filter (ApplicationWindow *parent, Graph *g=0, const QString &name=QString()) | |
Filter (ApplicationWindow *parent, Matrix *m, const QString &name=QString()) | |
Filter (ApplicationWindow *parent, QwtPlotCurve *c) | |
Graph * | outputGraph () |
Returns a pointer to the graph where the result curve should be displayed. More... | |
QwtPlotCurve * | resultCurve () |
Returns a pointer to the plot curve created to display the results. More... | |
Table * | resultTable () |
Returns a pointer to the table created to display the results. More... | |
void | setColor (int colorId) |
Obsolete: sets the color of the output fit curve. More... | |
void | setColor (const QColor &color) |
Sets the color of the output fit curve. More... | |
void | setColor (const QString &colorName) |
Sets the color of the output fit curve. Provided for convenience. To be used in scripts only! More... | |
bool | setDataFromCurve (QwtPlotCurve *c) |
bool | setDataFromCurve (QwtPlotCurve *c, double from, double to) |
bool | setDataFromCurve (const QString &curveTitle, Graph *g=0) |
bool | setDataFromCurve (const QString &curveTitle, double from, double to, Graph *g=0) |
void | setError (bool on=true) |
void | setInterval (double from, double to) |
Changes the data range if the source curve was already assigned. Provided for convenience. More... | |
void | setMaximumIterations (int iter) |
Sets the maximum number of iterations to be performed during an iterative session. More... | |
void | setOutputPoints (int points) |
Sets the number of points in the output curve. More... | |
void | setOutputPrecision (int digits) |
Sets the precision used for the output. More... | |
void | setSortData (bool on=true) |
void | setTolerance (double eps) |
Sets the tolerance used by the GSL routines. More... | |
void | setUpdateOutputGraph (bool update=true) |
virtual void | showLegend () |
Adds a new legend to the plot. Calls virtual legendInfo() More... | |
double * | x () |
Returns the x values of the input data set. More... | |
double * | y () |
Returns the y values of the input data set. More... | |
~Filter () | |
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. More... | |
virtual void | freeMemory () |
Frees all the arrays with size d_n. Used when changing the source data sets. More... | |
void | freeWorkspace () |
Frees the memory allocated for the fit workspace. More... | |
virtual void | generateFitCurve () |
Adds the result curve to the plot. More... | |
void | initWorkspace (int par) |
Allocates the memory for the fit workspace. More... | |
virtual FunctionCurve * | insertFitFunctionCurve (const QString &name, int penWidth=1, bool updateData=true) |
Adds the result curve as a FunctionCurve to the plot, if d_gen_function = true. More... | |
virtual QString | logFitInfo (int iterations, int status) |
Output string added to the result log. More... | |
![]() | |
QwtPlotCurve * | addResultCurve (double *x, double *y) |
Adds the result curve to the target output plot window. Creates a hidden table and frees the input data from memory. More... | |
virtual void | calculateOutputData (double *X, double *Y) |
Calculates the data for the output curve and store it in the X an Y vectors. More... | |
MultiLayer * | createOutputGraph () |
virtual int | curveData (QwtPlotCurve *c, double start, double end, double **x, double **y) |
int | curveIndex (const QString &curveTitle, Graph *g) |
Performs checks and returns the index of the source data curve if OK, -1 otherwise. More... | |
int | curveRange (QwtPlotCurve *c, double start, double end, int *iStart, int *iEnd) |
void | init () |
virtual QString | logInfo () |
Output string added to the log pannel of the application. More... | |
void | memoryErrorMessage () |
virtual void | output () |
Performs the data analysis and takes care of the output. More... | |
virtual int | sortedCurveData (QwtPlotCurve *c, double start, double end, double **x, double **y) |
Same as curveData, but sorts the points by their x value. More... | |
Protected Attributes | |
double | chi_2 |
The sum of squares of the residuals from the best-fit line. More... | |
gsl_matrix * | covar |
Covariance matrix. More... | |
double | d_adjusted_r_square |
Adjusted R^2. More... | |
Matrix * | d_cov_matrix |
Matrix window used for the output of covariance matrix. More... | |
fit_function_df | d_df |
double * | d_errors |
Stores standard deviations of the result parameters. More... | |
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. More... | |
FitType | d_fit_type |
QString | d_formula |
The fit formula given on input. More... | |
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. More... | |
int | d_p |
Number of fit parameters. More... | |
QStringList | d_param_explain |
Stores a list of short explanations for the significance of the fit parameters. More... | |
gsl_vector * | d_param_init |
Initial guesses for the fit parameters. More... | |
QStringList | d_param_names |
Names of the fit parameters. More... | |
double * | d_param_range_left |
Stores the left limits of the research interval for the result parameters. More... | |
double * | d_param_range_right |
Stores the right limits of the research interval for the result parameters. More... | |
QPointer< Table > | d_param_table |
Table window used for the output of fit parameters. More... | |
double * | d_residuals |
Stores fit residuals. More... | |
QString | d_result_formula |
The result fit formula, where the fit parameters are replaced with the calculated values. More... | |
double * | d_results |
Stores the result parameters. More... | |
double | d_rss |
Residual sum of squares. More... | |
bool | d_scale_errors |
Specifies wheather the errors must be scaled with sqrt(chi_2/dof) More... | |
Algorithm | d_solver |
Algorithm type. More... | |
double * | d_w |
weighting data set used for the fit More... | |
WeightingMethod | d_weighting |
The kind of weighting to be performed on the data. More... | |
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. More... | |
QString | weighting_dataset |
The name of the weighting dataset. More... | |
![]() | |
QwtPlotCurve * | d_curve |
The curve to be analysed. More... | |
QColor | d_curveColor |
Color index of the result curve. More... | |
QString | d_explanation |
String explaining the operation in the comment of the result table and in the project explorer. More... | |
double | d_from |
Data interval. More... | |
Graph * | d_graph |
The source graph with the curve to be analyzed. More... | |
bool | d_graphics_display |
Specifies if the filter should display a result curve. More... | |
bool | d_init_err |
Error flag telling if something went wrong during the initialization phase. More... | |
Matrix * | d_matrix |
int | d_max_iterations |
Maximum number of iterations per fit. More... | |
int | d_min_points |
Minimum number of data points necessary to perform the operation. More... | |
int | d_n |
Size of the data arrays. More... | |
Graph * | d_output_graph |
The graph where the result curve should be displayed. More... | |
int | d_points |
Number of result points to de calculated and displayed in the output curve. More... | |
int | d_prec |
Precision (number of significant digits) used for the results output. More... | |
QwtPlotCurve * | d_result_curve |
The resulting curve. More... | |
Table * | d_result_table |
The table displaying the results of the filtering operation (not alvays valid!) More... | |
bool | d_sort_data |
Specifies if the filter needs sorted data as input. More... | |
Table * | d_table |
A table source of data. More... | |
double | d_to |
double | d_tolerance |
GSL Tolerance, if ever needed... More... | |
bool | d_update_output_graph |
Specifies if the filter should update the output graph. More... | |
double * | d_x |
x data set to be analysed More... | |
double * | d_y |
y data set to be analysed More... | |
QString | d_y_col_name |
Private Member Functions | |
virtual void | customizeFitResults () |
Customs and stores the fit results according to the derived class specifications. Used by exponential fits. More... | |
gsl_multifit_fdfsolver * | fitGSL (gsl_multifit_function_fdf f, int &iterations, int &status) |
Pointer to the GSL multifit solver. More... | |
gsl_multimin_fminimizer * | fitSimplex (gsl_multimin_function f, int &iterations, int &status) |
Pointer to the GSL multifit minimizer (for simplex algorithm) More... | |
void | init () |
virtual bool | removeDataSingularities () |
Removes any data singularities before fitting. More... | |
Fit base class.
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, |
QwtPlotCurve * | c | ||
) |
References init().
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, freeMemory(), and freeWorkspace().
|
inline |
Returns adjusted R^2.
References d_adjusted_r_square.
|
inlineprotectedvirtual |
Calculates the data for the output fit curve and store itin the X an Y vectors.
Reimplemented in GaussAmpFit, LinearSlopeFit, ThreeExpFit, LinearFit, TwoExpFit, NonLinearFit, PolynomialFit, ExponentialFit, SigmoidalFit, PluginFit, and LogisticFit.
References logFitInfo().
Referenced by generateFitCurve().
|
inline |
Returns the sum of squares of the residuals from the best-fit line.
References chi_2, and rSquare().
Referenced by ApplicationWindow::fitLinear(), and ApplicationWindow::fitSlope().
Matrix * Fit::covarianceMatrix | ( | const QString & | matrixName | ) |
|
inlineprivatevirtual |
Customs and stores the fit results according to the derived class specifications. Used by exponential fits.
Reimplemented in MultiPeakFit, and ExponentialFit.
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.
Referenced by FitDialog::accept(), and results().
|
inlinevirtual |
Calculates the data for the output fit curve.
Reimplemented in GaussAmpFit, LinearSlopeFit, ThreeExpFit, LinearFit, TwoExpFit, MultiPeakFit, PolynomialFit, NonLinearFit, ExponentialFit, LogisticFit, PluginFit, and SigmoidalFit.
References fitGSL(), fitSimplex(), and init().
Referenced by residuals(), rSquare(), showConfidenceLimits(), and showPredictionLimits().
|
inline |
|
virtual |
Actually does the fit. Should be reimplemented in derived classes.
Reimplemented in LinearSlopeFit, LinearFit, and PolynomialFit.
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_solver, Filter::d_table, d_w, Filter::d_x, Filter::d_y, fitGSL(), fitSimplex(), generateFitCurve(), logFitInfo(), NelderMeadSimplex, removeDataSingularities(), ApplicationWindow::updateLog(), and ApplicationWindow::writeFitResultsToLog.
Referenced by FitDialog::accept(), ApplicationWindow::analyzeCurve(), MultiPeakFitTool::finalize(), ExpDecayDialog::fit(), and run().
|
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.
|
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.
|
inline |
|
protectedvirtual |
Frees all the arrays with size d_n. Used when changing the source data sets.
Reimplemented from Filter.
References d_residuals, d_w, and Filter::freeMemory().
Referenced by removeDataSingularities(), and ~Fit().
|
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 removeDataSingularities(), MultiPeakFit::setNumPeaks(), PolynomialFit::setOrder(), NonLinearFit::setParametersList(), and ~Fit().
|
protectedvirtual |
Adds the result curve to the plot.
Reimplemented in MultiPeakFit.
References 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, Filter::d_update_output_graph, insertFitFunctionCurve(), FitData::X, and FitData::Y.
Referenced by PolynomialFit::fit(), fit(), LinearFit::fit(), LinearSlopeFit::fit(), and removeDataSingularities().
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(), ExpDecayDialog::fit(), PolynomFitDialog::fit(), ApplicationWindow::fitLinear(), ApplicationWindow::fitSlope(), MultiPeakFitTool::MultiPeakFitTool(), and setAlgorithm().
|
inlinevirtual |
Reimplemented in GaussAmpFit, MultiPeakFit, SigmoidalFit, and LogisticFit.
References setParameterRange().
Referenced by ApplicationWindow::analyzeCurve(), and FitDialog::guessInitialValues().
|
private |
References BuiltIn, chi_2, covar, d_adjusted_r_square, d_cov_matrix, Filter::d_curve, Filter::d_curveColor, 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_w, d_weighting, Filter::d_x, Filter::d_y, is_non_linear, NoWeighting, ScaledLevenbergMarquardt, and weighting_dataset.
Referenced by eval(), Fit(), MultiPeakFit::MultiPeakFit(), and MultiPeakFit::profile().
|
inline |
References d_param_init.
Referenced by MultiPeakFitTool::finalize(), FitDialog::guessInitialValues(), FitDialog::loadInitialGuesses(), FitDialog::loadUserFunctions(), and FitDialog::showFitPage().
|
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 LogisticFit::init(), ExponentialFit::init(), SigmoidalFit::init(), TwoExpFit::init(), ThreeExpFit::init(), GaussAmpFit::init(), PluginFit::load(), removeDataSingularities(), MultiPeakFit::setNumPeaks(), PolynomialFit::setOrder(), and NonLinearFit::setParametersList().
|
protectedvirtual |
Adds the result curve as a FunctionCurve to the plot, if d_gen_function = true.
Reimplemented in NonLinearFit.
References Graph::addFitCurve(), Filter::d_curve, Filter::d_curveColor, d_formula, Filter::d_from, Filter::d_output_graph, d_p, d_param_names, Filter::d_points, Filter::d_result_curve, d_results, Filter::d_to, Graph::generateFunctionName(), Graph::insertPlotItem(), Graph::Line, FunctionCurve::loadData(), FunctionCurve::Normal, FunctionCurve::setConstant(), FunctionCurve::setFormula(), and FunctionCurve::setRange().
Referenced by MultiPeakFit::generateFitCurve(), generateFitCurve(), NonLinearFit::insertFitFunctionCurve(), and removeDataSingularities().
double Fit::lcl | ( | int | parIndex, |
double | confidenceLevel | ||
) |
Lower Confidence Limit.
References covar, Filter::d_n, d_p, and d_results.
Referenced by results(), showConfidenceLimits(), and showPredictionLimits().
|
virtual |
Output string added to the plot as a new legend.
Reimplemented from Filter.
Reimplemented in NonLinearFit, and 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, and rSquare().
Referenced by NonLinearFit::legendInfo(), and setAlgorithm().
bool Fit::load | ( | const QString & | fileName | ) |
References d_file_name, and fileName().
Referenced by FitDialog::loadInitialGuesses(), FitDialog::loadUserFunctions(), and scaleErrors().
|
protectedvirtual |
Output string added to the result log.
Reimplemented in MultiPeakFit, and NonLinearFit.
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, Direct, Instrumental, is_non_linear, Graph::multiLayer(), NelderMeadSimplex, NoWeighting, rSquare(), Statistical, UnscaledLevenbergMarquardt, and weighting_dataset.
Referenced by calculateFitCurveData(), PolynomialFit::fit(), fit(), LinearFit::fit(), LinearSlopeFit::fit(), NonLinearFit::logFitInfo(), and MultiPeakFit::logFitInfo().
|
inline |
References d_p.
Referenced by FitDialog::guessInitialValues(), FitDialog::loadInitialGuesses(), FitDialog::loadUserFunctions(), and FitDialog::showFitPage().
|
inline |
References d_param_names.
Referenced by FitDialog::setFunction(), FitDialog::showFitPage(), user_d(), user_df(), and user_f().
Table * Fit::parametersTable | ( | const QString & | tableName | ) |
References d_p, d_param_table, ApplicationWindow::generateUniqueName(), ApplicationWindow::newTable(), Table::None, ApplicationWindow::table(), Table::Text, writeParametersToTable(), and Table::yErr.
Referenced by scaleErrors(), and FitDialog::showParametersTable().
|
inlineprivatevirtual |
Removes any data singularities before fitting.
Reimplemented in NonLinearFit.
References freeMemory(), freeWorkspace(), generateFitCurve(), initWorkspace(), and insertFitFunctionCurve().
Referenced by fit().
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().
Referenced by results().
|
inline |
References d_result_formula.
|
inline |
Returns a vector with the fit results.
References d_results, errors(), lcl(), residuals(), showConfidenceLimits(), showPredictionLimits(), showResiduals(), and ucl().
Referenced by FitDialog::accept(), ExpDecayDialog::fit(), ApplicationWindow::fitLinear(), and ApplicationWindow::fitSlope().
|
inline |
Returns the Root Mean Squared Error.
References Filter::d_n, d_p, and d_rss.
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 chiSquare(), ApplicationWindow::fitLinear(), ApplicationWindow::fitSlope(), legendInfo(), and logFitInfo().
|
inline |
Returns the Residual Sum of Squares.
References d_rss.
|
inlinevirtual |
Actually does the job. Should be reimplemented in derived classes.
Reimplemented from Filter.
References fit(), setDataCurve(), setDataFromTable(), and setWeightingData().
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 fileName().
Referenced by ApplicationWindow::saveFitFunctions(), FitDialog::saveInitialGuesses(), FitDialog::saveUserFunction(), and scaleErrors().
|
inline |
Specifies wheather the errors must be scaled with sqrt(chi_2/dof)
References covarianceMatrix(), d_scale_errors, fileName(), load(), parametersTable(), save(), and writeParametersToTable().
Referenced by FitDialog::accept(), ApplicationWindow::analyzeCurve(), and ExpDecayDialog::fit().
|
inline |
References d_solver, generateFunction(), and legendInfo().
Referenced by FitDialog::accept().
|
virtual |
Reimplemented from Filter.
References Filter::d_curve, Filter::d_graph, Filter::d_n, d_w, d_weighting, ErrorBarsCurve::errorValue(), Graph::Function, Instrumental, Filter::memoryErrorMessage(), Filter::setDataCurve(), type(), weighting_dataset, and ErrorBarsCurve::xErrors().
Referenced by run().
|
virtual |
Reimplemented from Filter.
References Filter::d_n, d_w, Filter::memoryErrorMessage(), 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(), run(), SigmoidalFit::SigmoidalFit(), ThreeExpFit::ThreeExpFit(), and TwoExpFit::TwoExpFit().
|
inline |
References d_file_name.
Referenced by FitDialog::chooseFitModelsFolder(), FitDialog::initBuiltInFunctions(), FitDialog::loadPlugins(), and FitDialog::loadUserFunctions().
|
inlinevirtual |
Reimplemented in NonLinearFit.
Referenced by FitModelHandler::endElement(), FitDialog::saveUserFunction(), and FitDialog::showFitPage().
|
inline |
References d_param_init, and setInitialGuesses().
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(), ExpDecayDialog::fit(), and setInitialGuess().
|
inline |
References d_param_explain.
Referenced by FitModelHandler::endElement().
void Fit::setParameterRange | ( | int | parIndex, |
double | left, | ||
double | right | ||
) |
References d_p, d_param_range_left, and d_param_range_right.
Referenced by FitDialog::accept(), and guessInitialValues().
|
inlinevirtual |
Reimplemented in NonLinearFit.
Referenced by FitModelHandler::endElement().
|
inline |
References d_fit_type.
Referenced by FitModelHandler::endElement().
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, Direct, Filter::error(), DataCurve::errorBarsList(), ErrorBarsCurve::errorValue(), Graph::Function, Instrumental, Filter::memoryErrorMessage(), NoWeighting, Table::numRows(), Statistical, type(), weighting_dataset, and ErrorBarsCurve::xErrors().
Referenced by FitDialog::accept(), and run().
void Fit::showConfidenceLimits | ( | double | confidenceLevel | ) |
References ColorBox::color(), ColorBox::colorIndex(), Filter::createOutputGraph(), Filter::d_curveColor, Filter::d_explanation, Filter::d_from, d_gen_function, Filter::d_graphics_display, Filter::d_n, Filter::d_output_graph, d_p, Filter::d_points, d_results, d_rss, Filter::d_to, 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 results(), and FitDialog::showConfidenceLimits().
void Fit::showPredictionLimits | ( | double | confidenceLevel | ) |
References ColorBox::color(), ColorBox::colorIndex(), Filter::createOutputGraph(), Filter::d_curveColor, Filter::d_explanation, Filter::d_from, d_gen_function, Filter::d_graphics_display, Filter::d_n, Filter::d_output_graph, d_p, Filter::d_points, d_results, d_rss, Filter::d_to, 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 results(), and FitDialog::showPredictionLimits().
QwtPlotCurve * Fit::showResiduals | ( | ) |
Plot residuals and display data values in a column.
References ColorBox::color(), ColorBox::colorIndex(), Filter::createOutputGraph(), Filter::d_curveColor, 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 results(), and FitDialog::showResiduals().
|
inline |
References d_fit_type.
Referenced by FitDialog::accept(), FitDialog::guessInitialValues(), FitDialog::loadUserFunctions(), setDataCurve(), setWeightingData(), and FitDialog::showFitPage().
double Fit::ucl | ( | int | parIndex, |
double | confidenceLevel | ||
) |
Upper Confidence Limit.
References covar, Filter::d_n, d_p, and d_results.
Referenced by results(), showConfidenceLimits(), and showPredictionLimits().
void Fit::writeParametersToTable | ( | Table * | t, |
bool | append = false |
||
) |
References chi_2, covar, Filter::d_n, d_p, d_param_names, Filter::d_prec, d_results, d_scale_errors, Table::numCols(), Table::numRows(), Table::setNumCols(), Table::setNumRows(), Table::setText(), and Table::table().
Referenced by FitDialog::accept(), parametersTable(), and scaleErrors().
|
protected |
The sum of squares of the residuals from the best-fit line.
Referenced by chiSquare(), errors(), PolynomialFit::fit(), fit(), LinearFit::fit(), LinearSlopeFit::fit(), init(), legendInfo(), logFitInfo(), and writeParametersToTable().
|
protected |
Covariance matrix.
Referenced by covarianceMatrix(), errors(), PolynomialFit::fit(), fit(), LinearFit::fit(), LinearSlopeFit::fit(), fitGSL(), freeWorkspace(), LinearFit::init(), LinearSlopeFit::init(), init(), initWorkspace(), lcl(), legendInfo(), logFitInfo(), ucl(), and writeParametersToTable().
|
protected |
Adjusted R^2.
Referenced by adjustedRSquare(), init(), logFitInfo(), and rSquare().
|
protected |
Matrix window used for the output of covariance matrix.
Referenced by covarianceMatrix(), and init().
|
protected |
|
protected |
Stores standard deviations of the result parameters.
Referenced by errors(), freeWorkspace(), and init().
|
protected |
|
protected |
|
protected |
Path of the XML file where the user stores the fit model.
Referenced by fileName(), load(), save(), and setFileName().
|
protected |
Referenced by PluginFit::init(), NonLinearFit::init(), init(), save(), setType(), and type().
|
protected |
The fit formula given on input.
Referenced by NonLinearFit::calculateFitCurveData(), NonLinearFit::eval(), fit(), formula(), LogisticFit::init(), ExponentialFit::init(), SigmoidalFit::init(), NonLinearFit::init(), TwoExpFit::init(), LinearFit::init(), ThreeExpFit::init(), LinearSlopeFit::init(), GaussAmpFit::init(), init(), insertFitFunctionCurve(), legendInfo(), PluginFit::load(), logFitInfo(), NonLinearFit::removeDataSingularities(), save(), NonLinearFit::setFormula(), MultiPeakFit::setNumPeaks(), and PolynomialFit::setOrder().
|
protected |
|
protected |
Specifies weather the result curve is a FunctionCurve or a normal curve with the same x values as the fit data.
Referenced by LogisticFit::calculateFitCurveData(), PluginFit::calculateFitCurveData(), ExponentialFit::calculateFitCurveData(), SigmoidalFit::calculateFitCurveData(), PolynomialFit::calculateFitCurveData(), NonLinearFit::calculateFitCurveData(), TwoExpFit::calculateFitCurveData(), LinearFit::calculateFitCurveData(), ThreeExpFit::calculateFitCurveData(), LinearSlopeFit::calculateFitCurveData(), GaussAmpFit::calculateFitCurveData(), MultiPeakFit::generateFitCurve(), generateFitCurve(), generateFunction(), init(), showConfidenceLimits(), and showPredictionLimits().
|
protected |
Number of fit parameters.
Referenced by PolynomialFit::calculateFitCurveData(), NonLinearFit::calculateFitCurveData(), covarianceMatrix(), errors(), NonLinearFit::eval(), PolynomialFit::eval(), MultiPeakFit::eval(), PolynomialFit::fit(), fit(), LinearFit::fit(), LinearSlopeFit::fit(), fitGSL(), fitSimplex(), MultiPeakFit::generateFitCurve(), LogisticFit::init(), ExponentialFit::init(), SigmoidalFit::init(), TwoExpFit::init(), LinearFit::init(), ThreeExpFit::init(), LinearSlopeFit::init(), GaussAmpFit::init(), init(), insertFitFunctionCurve(), MultiPeakFit::insertPeakFunctionCurve(), lcl(), PolynomialFit::legendInfo(), legendInfo(), PluginFit::load(), logFitInfo(), numParameters(), parametersTable(), NonLinearFit::removeDataSingularities(), rmse(), rSquare(), save(), NonLinearFit::setFormula(), setInitialGuesses(), MultiPeakFit::setNumPeaks(), PolynomialFit::setOrder(), setParameterRange(), NonLinearFit::setParametersList(), showConfidenceLimits(), showPredictionLimits(), ucl(), writeParametersToTable(), and ~Fit().
|
protected |
Stores a list of short explanations for the significance of the fit parameters.
Referenced by LogisticFit::init(), ExponentialFit::init(), SigmoidalFit::init(), TwoExpFit::init(), LinearFit::init(), ThreeExpFit::init(), LinearSlopeFit::init(), LorentzFit::init(), GaussFit::init(), GaussAmpFit::init(), PluginFit::load(), logFitInfo(), save(), MultiPeakFit::setNumPeaks(), PolynomialFit::setOrder(), setParameterExplanations(), and NonLinearFit::setParametersList().
|
protected |
Initial guesses for the fit parameters.
Referenced by PolynomialFit::fit(), fitGSL(), fitSimplex(), freeWorkspace(), LogisticFit::guessInitialValues(), SigmoidalFit::guessInitialValues(), MultiPeakFit::guessInitialValues(), GaussAmpFit::guessInitialValues(), LinearFit::init(), LinearSlopeFit::init(), init(), initialGuess(), initWorkspace(), NonLinearFit::removeDataSingularities(), save(), NonLinearFit::setFormula(), setInitialGuess(), and setInitialGuesses().
|
protected |
Names of the fit parameters.
Referenced by NonLinearFit::calculateFitCurveData(), NonLinearFit::eval(), LogisticFit::init(), ExponentialFit::init(), SigmoidalFit::init(), TwoExpFit::init(), LinearFit::init(), ThreeExpFit::init(), LinearSlopeFit::init(), GaussAmpFit::init(), insertFitFunctionCurve(), MultiPeakFit::insertPeakFunctionCurve(), legendInfo(), PluginFit::load(), logFitInfo(), parameterNames(), NonLinearFit::removeDataSingularities(), save(), NonLinearFit::setFormula(), MultiPeakFit::setNumPeaks(), PolynomialFit::setOrder(), NonLinearFit::setParametersList(), and writeParametersToTable().
|
protected |
Stores the left limits of the research interval for the result parameters.
Referenced by fitGSL(), fitSimplex(), freeWorkspace(), init(), initWorkspace(), and setParameterRange().
|
protected |
Stores the right limits of the research interval for the result parameters.
Referenced by fitGSL(), fitSimplex(), freeWorkspace(), init(), initWorkspace(), and setParameterRange().
|
protected |
Table window used for the output of fit parameters.
Referenced by init(), and parametersTable().
|
protected |
Stores fit residuals.
Referenced by freeMemory(), init(), residuals(), rSquare(), and showResiduals().
|
protected |
The result fit formula, where the fit parameters are replaced with the calculated values.
Referenced by init(), and resultFormula().
|
protected |
Stores the result parameters.
Referenced by LogisticFit::calculateFitCurveData(), PluginFit::calculateFitCurveData(), ExponentialFit::calculateFitCurveData(), SigmoidalFit::calculateFitCurveData(), PolynomialFit::calculateFitCurveData(), NonLinearFit::calculateFitCurveData(), TwoExpFit::calculateFitCurveData(), LinearFit::calculateFitCurveData(), ThreeExpFit::calculateFitCurveData(), LinearSlopeFit::calculateFitCurveData(), GaussAmpFit::calculateFitCurveData(), ExponentialFit::customizeFitResults(), MultiPeakFit::customizeFitResults(), PolynomialFit::fit(), LinearFit::fit(), LinearSlopeFit::fit(), fitGSL(), fitSimplex(), freeWorkspace(), MultiPeakFit::generateFitCurve(), LinearFit::init(), LinearSlopeFit::init(), init(), initWorkspace(), insertFitFunctionCurve(), MultiPeakFit::insertPeakFunctionCurve(), lcl(), PolynomialFit::legendInfo(), legendInfo(), MultiPeakFit::logFitInfo(), logFitInfo(), residuals(), results(), rSquare(), showConfidenceLimits(), showPredictionLimits(), ucl(), and writeParametersToTable().
|
protected |
Residual sum of squares.
Referenced by init(), logFitInfo(), rmse(), rSquare(), rss(), showConfidenceLimits(), and showPredictionLimits().
|
protected |
Specifies wheather the errors must be scaled with sqrt(chi_2/dof)
Referenced by errors(), PolynomialFit::init(), LinearFit::init(), LinearSlopeFit::init(), init(), legendInfo(), logFitInfo(), scaleErrors(), and writeParametersToTable().
|
protected |
Algorithm type.
Referenced by fit(), fitGSL(), init(), logFitInfo(), and setAlgorithm().
|
protected |
weighting data set used for the fit
Referenced by PolynomialFit::fit(), fit(), LinearFit::fit(), LinearSlopeFit::fit(), freeMemory(), init(), NonLinearFit::removePole(), rSquare(), setDataCurve(), setDataFromTable(), and setWeightingData().
|
protected |
The kind of weighting to be performed on the data.
Referenced by PolynomialFit::fit(), LinearFit::fit(), LinearSlopeFit::fit(), init(), logFitInfo(), setDataCurve(), and setWeightingData().
|
protected |
Tells whether the fitter uses non-linear/simplex fitting with an initial parameters set, that must be freed in the destructor.
Referenced by PolynomialFit::init(), LinearFit::init(), LinearSlopeFit::init(), init(), and logFitInfo().
|
protected |
The name of the weighting dataset.
Referenced by init(), logFitInfo(), setDataCurve(), and setWeightingData().