Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

ChiSqFCN Class Reference

#include <ChiSqFCN.h>

Inheritance diagram for ChiSqFCN:

Inheritance graph
[legend]
Collaboration diagram for ChiSqFCN:

Collaboration graph
[legend]
List of all members.

Detailed Description

A derived class for StatedFCN class.

This class uses Chi-Square as the basis of minimization.

Author:
Paul F. Kunz <Paul_Kunz@slac.stanford.edu>

Definition at line 24 of file ChiSqFCN.h.

Public Member Functions

virtual void calcAlphaBeta (std::vector< std::vector< double > > &alpha, std::vector< double > &beta)=0
virtual StatedFCNclone () const =0
 Makes a copy of the derived class object.
virtual int degreesOfFreedom () const =0
 Returns the number of degrees of freedom.
virtual double errorDef () const
virtual void getFreeParameters (std::vector< double > &parms) const
 Returns the free parameters in the vector parms.
virtual bool needsIntegrated () const =0
 Returns true if data points were integrated.
virtual double objectiveValue () const =0
 Returns the value of the objective function.
double objectiveValue (const std::vector< double > &x, const std::vector< double > &y, const std::vector< double > &e) const
 Returns value of the objective function.
virtual double operator() (const std::vector< double > &parms) const
 Calculates and returns the objective function to be minimized.
virtual void setDataSource (const DataSource *source)=0
 Sets the data source for the objective function.
virtual void setFreeParameters (const std::vector< double > &parms)
 Sets the free parameters from the vector parms.
void setFunction (FunctionBase *function)
 Sets the model function.
virtual bool setUseErrors (bool yes=true)=0
 Sets the FCN to use errors on the data source values if it can.
virtual double up () const

Protected Attributes

FunctionBasem_function
 A pointer to the model function to be used in fitting.
bool m_has_errors
 Error use flag.


Member Function Documentation

virtual void StatedFCN::calcAlphaBeta std::vector< std::vector< double > > &  alpha,
std::vector< double > &  beta
[pure virtual, inherited]
 

Implemented in NTupleFCN.

virtual StatedFCN* StatedFCN::clone  )  const [pure virtual, inherited]
 

Makes a copy of the derived class object.

Implemented in NTupleChiSqFCN, NTupleLikeliHoodFCN, and NTuplePearsonFCN.

virtual int StatedFCN::degreesOfFreedom  )  const [pure virtual, inherited]
 

Returns the number of degrees of freedom.

Implemented in NTupleFCN.

double ChiSqFCN::errorDef  )  const [virtual]
 

Reimplemented from FCNBase.

Definition at line 22 of file ChiSqFCN.cxx.

References up().

void StatedFCN::getFreeParameters std::vector< double > &  parms  )  const [virtual, inherited]
 

Returns the free parameters in the vector parms.

Definition at line 53 of file StatedFCN.cxx.

References StatedFCN::m_function.

Referenced by NTupleFCN::degreesOfFreedom().

virtual bool StatedFCN::needsIntegrated  )  const [pure virtual, inherited]
 

Returns true if data points were integrated.

Return true if the FCN function needs data points were integrated over a range. An example would be a histogram. Returns false if the integrated data points are not needed.

Implemented in NTupleChiSqFCN, NTupleLikeliHoodFCN, and NTuplePearsonFCN.

virtual double StatedFCN::objectiveValue  )  const [pure virtual, inherited]
 

Returns the value of the objective function.

Returns the value of the objective function for the current state of the function. The state of the function's parameters is set by operator(). Other states the function may have is set by calling member functions of the function directly.

Implemented in NTupleChiSqFCN, NTupleLikeliHoodFCN, and NTuplePearsonFCN.

Referenced by NTuplePearsonFCN::objectiveValue(), NTupleChiSqFCN::objectiveValue(), and StatedFCN::operator()().

double ChiSqFCN::objectiveValue const std::vector< double > &  x,
const std::vector< double > &  y,
const std::vector< double > &  e
const
 

Returns value of the objective function.

Returns the value of the objective function for the current state of the function with the data set represented by the vectors.

Parameters:
x A vector of X coordinates.
y A vector of Y coordinates.
e A vector of errors on the Y coordinate.

Definition at line 36 of file ChiSqFCN.cxx.

References StatedFCN::operator()().

double StatedFCN::operator() const std::vector< double > &  parms  )  const [virtual, inherited]
 

Calculates and returns the objective function to be minimized.

This objective function could be a Chi-Squared function or could be a LikleHood function.

Implements FCNBase.

Definition at line 67 of file StatedFCN.cxx.

References StatedFCN::m_function, StatedFCN::objectiveValue(), and StatedFCN::setFreeParameters().

Referenced by NTupleFCN::calcAlphaBeta(), PearsonFCN::objectiveValue(), and objectiveValue().

virtual void StatedFCN::setDataSource const DataSource source  )  [pure virtual, inherited]
 

Sets the data source for the objective function.

Implemented in NTupleFCN.

void StatedFCN::setFreeParameters const std::vector< double > &  parms  )  [virtual, inherited]
 

Sets the free parameters from the vector parms.

Definition at line 60 of file StatedFCN.cxx.

References StatedFCN::m_function.

Referenced by StatedFCN::operator()().

void StatedFCN::setFunction FunctionBase function  )  [inherited]
 

Sets the model function.

Sets the model function object to function.

Definition at line 46 of file StatedFCN.cxx.

References StatedFCN::m_function.

virtual bool StatedFCN::setUseErrors bool  yes = true  )  [pure virtual, inherited]
 

Sets the FCN to use errors on the data source values if it can.

Implemented in NTupleFCN.

double ChiSqFCN::up  )  const [virtual]
 

Implements FCNBase.

Definition at line 29 of file ChiSqFCN.cxx.

Referenced by errorDef().


Member Data Documentation

FunctionBase* StatedFCN::m_function [protected, inherited]
 

A pointer to the model function to be used in fitting.

This object does not own the function.

Definition at line 51 of file StatedFCN.h.

Referenced by StatedFCN::getFreeParameters(), StatedFCN::operator()(), StatedFCN::setFreeParameters(), and StatedFCN::setFunction().

bool StatedFCN::m_has_errors [protected, inherited]
 

Error use flag.

A flag set to true, if errors on measured points are to be used. When set true, only data points with non-zero errors are used. When set false, all error on data points is set to 1.0

Definition at line 58 of file StatedFCN.h.


The documentation for this class was generated from the following files:
Generated for HippoDraw-1.12.6.1 by doxygen 1.3.9.1