|
unsigned | findOutliers (double nSigmaCut, MeasuredStarList &msOutliers, FittedStarList &fsOutliers) const |
| Find Measurements and references contributing more than a cut, computed as
\[ <chi2> + nSigmaCut + rms(chi2). \]
The outliers are NOT removed, and no refit is done. More...
|
|
void | outliersContributions (MeasuredStarList &msOutliers, FittedStarList &fsOutliers, TripletList &tripletList, Eigen::VectorXd &grad) |
| Contributions to derivatives from (presumably) outlier terms. More...
|
|
void | removeMeasOutliers (MeasuredStarList &outliers) |
| Remove measuredStar outliers from the fit. No Refit done. More...
|
|
void | removeRefOutliers (FittedStarList &outliers) |
| Remove refStar outliers from the fit. No Refit done. More...
|
|
virtual void | getIndicesOfMeasuredStar (MeasuredStar const &measuredStar, std::vector< unsigned > &indices) const =0 |
| Set the indices of a measured star from the full matrix, for outlier removal. More...
|
|
virtual void | accumulateStatImageList (CcdImageList const &ccdImageList, Chi2Accumulator &accum) const =0 |
| Compute the chi2 (per star or total, depending on which Chi2Accumulator is used) for measurements. More...
|
|
virtual void | accumulateStatRefStars (Chi2Accumulator &accum) const =0 |
| Compute the chi2 (per star or total, depending on which Chi2Accumulator is used) for RefStars. More...
|
|
virtual void | leastSquareDerivativesMeasurement (CcdImage const &ccdImage, TripletList &tripletList, Eigen::VectorXd &grad, MeasuredStarList const *measuredStarList=nullptr) const =0 |
| Compute the derivatives of the measured stars and model for one CcdImage. More...
|
|
virtual void | leastSquareDerivativesReference (FittedStarList const &fittedStarList, TripletList &tripletList, Eigen::VectorXd &grad) const =0 |
| Compute the derivatives of the reference terms. More...
|
|
Base class for fitters.
Implements minimize and findOutliers. Chi2, residual, derivative, etc. calculations must be implemented in the child class via the virtual methods.
Definition at line 29 of file FitterBase.h.
Find Measurements and references contributing more than a cut, computed as
\[ <chi2> + nSigmaCut + rms(chi2). \]
The outliers are NOT removed, and no refit is done.
After returning from here, there are still measurements that contribute above the cut, but their contribution should be evaluated after a refit before discarding them.
- Parameters
-
[in] | nSigmaCut | Number of sigma to select on. |
[out] | msOutliers | list of MeasuredStar outliers to populate |
[out] | fsOutliers | list of FittedStar outliers to populate |
- Returns
- Total number of outliers that were removed.
Definition at line 25 of file FitterBase.cc.
void lsst::jointcal::FitterBase::leastSquareDerivatives |
( |
TripletList & |
tripletList, |
|
|
Eigen::VectorXd & |
grad |
|
) |
| const |
Evaluates the chI^2 derivatives (Jacobian and gradient) for the current whatToFit setting.
The Jacobian is given as triplets in a sparse matrix, the gradient as a dense vector. The parameters which vary, and their indices, are to be set using assignIndices.
- Parameters
-
tripletList | tripletList of (row,col,value) representing the Jacobian of the chi2. |
grad | The gradient of the chi2. |
Definition at line 230 of file FitterBase.cc.
Does a 1 step minimization, assuming a linear model.
This is a complete Newton Raphson step. Compute first and second derivatives, solve for the step and apply it, without a line search.
It calls assignIndices, leastSquareDerivatives, solves the linear system and calls offsetParams, then removes outliers in a loop if requested. Relies on sparse linear algebra.
- Parameters
-
[in] | whatToFit | See child method assignIndices for valid string values. |
[in] | nSigmaCut | How many sigma to reject outliers at. Outlier rejection ignored for nSigmaCut=0. |
- Returns
- Return code describing success/failure of fit.
- Note
- When fitting one parameter set by itself (e.g. "Model"), the system is purely linear, which should result in the optimal chi2 after a single step. This can be used to debug the fitter by fitting that parameter set twice in a row: the second run with the same "whatToFit" will produce no change in the fitted parameters, if the calculations and indices are defined correctly.
Definition at line 119 of file FitterBase.cc.
void lsst::jointcal::FitterBase::saveChi2Contributions |
( |
std::string const & |
baseName | ) |
const |
|
virtual |
Save the full chi2 term per star that was used in the minimization, for debugging.
Saves results to text files "baseName-meas.csv" and "baseName-ref.csv" for the MeasuredStar and RefStar contributions, respectively. This method is mostly useful for debugging: we will probably want to create a better persistence system for jointcal's internal representations in the future (see DM-12446).
Definition at line 238 of file FitterBase.cc.