File minimize.h

namespace lsst

Class for a simple mapping implementing a generic AstrometryTransform.

Remove all non-astronomical counts from the Chunk Exposure’s pixels.

Forward declarations for lsst::utils::Cache

For details on the Cache class, see the Cache.h file.

It uses a template rather than a pointer so that the derived classes can use the specifics of the transform. The class simplePolyMapping overloads a few routines.

A base class for image defects

Numeric constants used by the Integrate.h integrator routines.

Compute Image Statistics

Note

Gauss-Kronrod-Patterson quadrature coefficients for use in quadpack routine qng. These coefficients were calculated with 101 decimal digit arithmetic by L. W. Fullerton, Bell Labs, Nov 1981.

Note

The Statistics class itself can only handle lsst::afw::image::MaskedImage() types. The philosophy has been to handle other types by making them look like lsst::afw::image::MaskedImage() and reusing that code. Users should have no need to instantiate a Statistics object directly, but should use the overloaded makeStatistics() factory functions.

namespace afw
namespace math

Functions

template<typename ReturnT>
FitResults minimize(lsst::afw::math::Function1<ReturnT> const &function, std::vector<double> const &initialParameterList, std::vector<double> const &stepSizeList, std::vector<double> const &measurementList, std::vector<double> const &varianceList, std::vector<double> const &xPositionList, double errorDef)

Find the minimum of a function(x)

Uses the Minuit fitting package with a standard definition of chiSq (see MinimizerFunctionBase1).

Return

true if minimum is valid, false otherwise

Parameters
  • function: function(x) to be minimized

  • initialParameterList: initial guess for parameters

  • stepSizeList: step size for each parameter; use 0.0 to fix a parameter

  • measurementList: measured values

  • varianceList: variance for each measurement

  • xPositionList: x position of each measurement

  • errorDef: what is this?

To do:

  • Document stepSizeList better

  • Document errorDef

  • Compute stepSize automatically? (if so, find a different way to fix parameters)

Exceptions
  • lsst::pex::exceptions::InvalidParameterError: if any input vector is the wrong length

template<typename ReturnT>
FitResults minimize(lsst::afw::math::Function2<ReturnT> const &function, std::vector<double> const &initialParameterList, std::vector<double> const &stepSizeList, std::vector<double> const &measurementList, std::vector<double> const &varianceList, std::vector<double> const &xPositionList, std::vector<double> const &yPositionList, double errorDef)

Find the minimum of a function(x, y)

Uses the Minuit fitting package with a standard definition of chiSq. (see MinimizerFunctionBase2).

To do:

  • Document stepSizeList better

  • Document errorDef

  • Compute stepSize automatically? (if so, find a different way to fix parameters)

Return

true if minimum is valid, false otherwise

Parameters
  • function: function(x,y) to be minimized

  • initialParameterList: initial guess for parameters

  • stepSizeList: step size for each parameter; use 0.0 to fix a parameter

  • measurementList: measured values

  • varianceList: variance for each measurement

  • xPositionList: x position of each measurement

  • yPositionList: y position of each measurement

  • errorDef: what is this?

Exceptions
  • lsst::pex::exceptions::InvalidParameterError: if any input vector is the wrong length

struct FitResults
#include <minimize.h>

Results from minimizing a function

Public Members

bool isValid

true if the fit converged; false otherwise

double chiSq

chi squared; may be nan or infinite, but only if isValid false

std::vector<double> parameterList

fit parameters

std::vector<std::pair<double, double>> parameterErrorList

negative,positive (1 sigma?) error for each parameter