autolens.FitFluxes#
- class autolens.FitFluxes(name: str, fluxes: autoarray.structures.values.ValuesIrregular, noise_map: autoarray.structures.values.ValuesIrregular, positions: autoarray.structures.grids.irregular_2d.Grid2DIrregular, tracer: autolens.lens.ray_tracing.Tracer, point_profile: Optional[autogalaxy.profiles.point_sources.Point] = None)[source]#
- __init__(name: str, fluxes: autoarray.structures.values.ValuesIrregular, noise_map: autoarray.structures.values.ValuesIrregular, positions: autoarray.structures.grids.irregular_2d.Grid2DIrregular, tracer: autolens.lens.ray_tracing.Tracer, point_profile: Optional[autogalaxy.profiles.point_sources.Point] = None)[source]#
Class to fit a masked dataset where the dataset’s data structures are any dimension.
- Parameters
dataset (MaskedDataset) – The masked dataset (data, mask, noise-map, etc.) that is fitted.
model_data – The model data the masked dataset is fitted with.
inversion (LEq) – If the fit uses an LEq this is the instance of the object used to perform the fit. This determines if the log_likelihood or log_evidence is used as the figure_of_merit.
use_mask_in_fit – If True, masked data points are omitted from the fit. If False they are not (in most use cases the dataset will have been processed to remove masked points, for example the slim representation).
- residual_map#
The residual-map of the fit (data - model_data).
- chi_squared#
The overall chi-squared of the model’s fit to the dataset, summed over every data point.
- reduced_chi_squared#
The reduced chi-squared of the model’s fit to simulate (chi_squared / number of data points), summed over every data point.
- noise_normalization#
The overall normalization term of the noise_map, summed over every data point.
- log_likelihood#
The overall log likelihood of the model’s fit to the dataset, summed over evey data point.
Methods
__init__
(name, fluxes, noise_map, positions, …)Class to fit a masked dataset where the dataset’s data structures are any dimension.
Attributes
Returns the chi-squared terms of the model data’s fit to an dataset, by summing the chi-squared-map.
Returns the chi-squared-map between the residual-map and noise-map, where:
data
deflections_func
Returns the defleciton function, which given the image-plane positions computes their deflection angles.
figure_of_merit
fluxes
inversion
Overwrite this method so it returns the inversion used to fit the dataset.
log_evidence
Returns the log evidence of the inversion’s fit to a dataset, where the log evidence includes a number of terms which quantify the complexity of an inversion’s reconstruction (see the LEq module):
Returns the log likelihood of each model data point’s fit to the dataset, where:
log_likelihood_with_regularization
Returns the log likelihood of an inversion’s fit to the dataset, including a regularization term which comes from an inversion:
magnifications
The magnification of every position in the image-plane, which is computed from the tracer’s deflection angle map via the Hessian.
mask
Overwrite this method so it returns the mask of the dataset which is fitted to the input data.
model_data
The model-fluxes of the tracer at each of the image-plane positions.
model_fluxes
noise_map
Returns the noise-map normalization term of the noise-map, summing the noise_map value in every pixel as:
normalized_residual_map
Returns the normalized residual-map between the masked dataset and model data, where:
potential_chi_squared_map
The signal-to-noise_map of the dataset and noise-map which are fitted.
Returns the residual map, over riding the parent method so that the result is converted to a ValuesIrregular object.
signal_to_noise_map
The signal-to-noise_map of the dataset and noise-map which are fitted.
total_mappers