![]() | ![]() |
Astron. Astrophys. 355, 979-993 (2000) Appendix A: the 3D Gaussian fitting program "FG3"We have developed a computer program for the inspection and
analysis of spectral line cubes. In general, a spectral line cube is a
3-dimensional (3D) array in which two of the dimensions are sky
spatial coordinates (usually the right ascension
In the study of astronomical maser emission, we can model the
intensity distribution as produced by a number of (3D Gaussian) spots.
A spatially unresolved 3D Gaussian feature can be specified by eight
parameters, which are the Gaussian peak intensity
(
where
The derivatives of this 3D Gaussian function with respect to the eight parameters are
A.1. The Levenberg-Marquardt methodThe modeling of the spectral line data cube in terms of 3D Gaussian
features can be studied as a least-squares fitting problem, noting
that the model does not depend linearly with the parameters.
The intensity distribution is, in general, a non-linear function of
We are looking for a method to find these parameters (that we will
represent as
At the chi-square minimum, the following set of nonlinear equations must hold
for
where d is a M-vector, D is a M x M matrix, and a is a vector representing the parameters. Because of the nonlinear dependences, the minimization must proceed iteratively. Given the current trial parameters a cur, an improved trial solution is obtained as
and the procedure is repeated until
where D is the second derivative matrix (Hessian matrix). Because we know exactly the analytical form of
and the Hessian matrix
Defining the curvature matrix
where this set is solved for the increments
Furthermore, the second derivatives of
The Levenberg-Marquardt method has become the standard of the
nonlinear least-squares routines. It varies smoothly between the
steepest descent method, used far from the minimum, and the
inverse-Hessian method, used as the minimum is approached. By using
so when The Levenberg-Marquardt method for obtaining the set of parameters
a that minimize
The iteration process can stop the second time
is the estimated covariance matrix of the standard errors in the
fitted parameters a , calculated by setting
A.2. ImplementationWe have written a computer program to implement the
Levenberg-Marquardt method of fitting for the parameters
The power of "FG3" is shown in Figs. A.1 and A.2.
A.3. Using constraints on the parametersThe process of modeling the intensity distribution of a spectral
line source as a function of G tridimensional Gaussian sources
requires, in our general case, to find
In other cases, the iterative process may diverge due to an
"unfortunate" step in the parameter searching process. We might want
to force any parameter value to remain within a given range
(what we will call the selected accuracy of that parameter,
In order not to use the selected accuracy feature, it will
be enough to assign a large value to
A.4. Notes on the reliability of the solutionsThe Levenberg-Marquardt method solves a nonlinear problem by an approximation that has some limitations. First, the fitting procedure converges only if the initial values for the parameters are sufficiently close to the real ones. This limitation is overcome in the code by the parameter guessing routines. The number of Gaussian features to fit is a user input parameter, and inspection of the fit residuals is needed to select which value of such number is best. On the other hand, artifacts may appear when the user specifies a very unapropriate number of Gaussians to fit: a number too large produces very narrow features without any physical meaning, while a number too low results in features of large linewidths. Such features can also be seen in regions of low intensity, as a consequence of the large residuals obtained. The mathematical solutions should thus be inspected to check that
these solutions correspond to real features. One test would be that
the fitted Gaussian is associated with a spatial or velocity peak in
the data. Uncertain solutions are marked in Tables 2 to 6, and
should be used with caution.
© European Southern Observatory (ESO) 2000 Online publication: March 21, 2000 ![]() |