GaussMLE.GaussModel
Overview
GaussMLE.GaussModel — ModuleGaussModelThe GaussModel module offers a unified framework for defining, manipulating, and fitting Gaussian models to data. It prescribes a set of abstract types, concrete model types, and function signatures that are expected for fitting and simulation codes.
Abstract Types Hierarchy
GaussMLEParams{T}: An abstract type for the parameters of a Gaussian model.GaussMLEArgs{T}: An abstract type for model-specific arguments, such as non-fitted parameters.GaussMLEΣ{T}: An abstract type for representing the uncertainty associated with a Gaussian model.
Required Methods
Each concrete Gaussian model, such as :xynb, must implement the following methods:
model(θ, args, i, j): Calculates the model's predicted intensity at pixel locations(i, j)based on the parametersθand additional argumentsargs.gradient!(θ, args, out, i, j): Computes and stores the gradient of the model with respect to its parameters at pixel locations(i, j)in theoutarray.curvature!(θ, args, out, i, j): Computes and stores the diagonal elements of the model's Hessian matrix (curvature) at pixel locations(i, j)in theoutarray.initialize_parameters!(θ, data, boxsize, args): Initializes the parameters of the model type based on the provided 2D data matrix, box size, and additional argumentsargs.update!(θ, numerator, denominator): Updates the model parameters based on provided numerator and denominator arrays, typically sums of gradients and curvatures over data points.genargs(::Type{θ}, args): Returns an instance of the model-specificGaussMLEArgstype.genθ(::Type{θ}, boxsize): Returns an instance of theθ_xynbstype, initialized based on the givenboxsize.genΣ(::Type{θ}): Returns an instance of theΣ_xynbs` type, initialized with default values.
Notes
- All function are Parametric in the type
T, which is expected to be a subtype ofReal.
Concrete Models
xynb: A 2D Gaussian model that includes parameters for the x and y coordinates, sum intensity, and background.xynbs: An extended version ofxynbthat also includes an additional term for the PSF width, σ_PSF.
Internal Constants
MODEL_MAP: A dictionary that associates model symbols with their corresponding concrete types, facilitating internal model selection and mapping.