lsst.meas.modelfit
tickets.DM-23835-ge415fe5f37
|
Go to the documentation of this file.
24 #ifndef LSST_MEAS_MODELFIT_TruncatedGaussian_h_INCLUDED
25 #define LSST_MEAS_MODELFIT_TruncatedGaussian_h_INCLUDED
36 namespace lsst {
namespace meas {
namespace modelfit {
38 class TruncatedGaussianSampler;
39 class TruncatedGaussianEvaluator;
40 class TruncatedGaussianLogEvaluator;
250 template <
typename Derived>
260 ndarray::Array<Scalar const,2,1>
const & alpha,
261 ndarray::Array<Scalar,1,1>
const & output
281 template <
typename Derived>
289 ndarray::Array<Scalar const,2,1>
const & alpha,
290 ndarray::Array<Scalar,1,1>
const & output
329 ndarray::Array<Scalar,2,1>
const & alpha,
330 ndarray::Array<Scalar,1,1>
const & weights,
331 bool multiplyWeights=
false
343 return Sampler(*
this, strategy);
359 #endif // !LSST_MEAS_MODELFIT_TruncatedGaussian_h_INCLUDED
SampleStrategy
Enum that describes different ways of sampling from a multidimensional TruncatedGaussian.
Represents a multidimensional Gaussian function truncated at zero.
TruncatedGaussianEvaluator(TruncatedGaussian const &parent)
TruncatedGaussianSampler Sampler
static TruncatedGaussian fromStandardParameters(Vector const &mean, Matrix const &covariance)
Create from the "standard" mean and covariance parameters of the normal distribution.
double Scalar
Typedefs to be used for probability and parameter values.
Scalar getUntruncatedFraction() const
Return the fraction of the Gaussian integral that was truncated by the bounds.
Scalar operator()(afw::math::Random &rng, ndarray::Array< Scalar, 1, 1 > const &alpha) const
Draw a single sample from a TruncatedGaussian.
static TruncatedGaussian fromSeriesParameters(Scalar q0, Vector const &gradient, Matrix const &hessian)
Create from the first and second logarithmic derivatives of the Gaussian.
Vector maximize() const
Return the location of the maximum of the truncated Gaussian.
Helper class for drawing samples from a TruncatedGaussian.
int getDim() const
Return the dimensionality of the function.
Evaluator evaluate() const
Create an Evaluator object that can be used to efficiently evaluate the function.
TruncatedGaussianSampler(TruncatedGaussian const &parent, TruncatedGaussian::SampleStrategy strategy)
Draw from the untruncated Gaussian, and discard negative draws.
Helper class for evaluating the -log of a TruncatedGaussian.
Scalar operator()(Eigen::MatrixBase< Derived > const &alpha) const
TruncatedGaussianLogEvaluator(TruncatedGaussian const &parent)
Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > Vector
Scalar getLogPeakAmplitude() const
Return the -log of the peak amplitude of the untruncated function.
Create a similar Gaussian with no x-y covariance, and importance sample by drawing from the independe...
~TruncatedGaussianSampler()
Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > Matrix
Scalar getLogIntegral() const
Return the -log of the integral of the truncated function.
Scalar operator()(Eigen::MatrixBase< Derived > const &alpha) const
LogEvaluator evaluateLog() const
Create a LogEvaluator object that can be used to efficiently evaluate the -log of the function.
Helper class for evaluating the -log of a TruncatedGaussian.
TruncatedGaussianLogEvaluator LogEvaluator
Sampler sample(SampleStrategy strategy) const
Create a Sampler object that uses the given strategy.
TruncatedGaussianEvaluator Evaluator