Source searching can be viewed as a fitting operation, in which the psf profile is matched to the observed flux distribution. The presence of a source is indicated by a good fit with significantly non-zero amplitude. The weighted least squares solution to the fitting problem entails minimising the chi-squared distributed statistic
where A is the source strength. For a given trial source position
the optimum estimate of A is that which gives
,
i.e.
When the errors are Gaussian distributed, this can also be shown to be the maximum likelihood (ML) estimate of the source flux. The variance of this estimate is