The Gauss-Newton algorithm is a common approach for model fitting. Within the leastsquares routine, experimentally measured data (provided as a multidimensional input) are concatenated into a one-dimensional vector 𝐃𝐃 (N D × 1) where information regarding dimensionality is preserved in the ordering of data. Throughout the text we use bold letters to denote vectors and matrices. We denote the residual between data 𝐃𝐃 and lineshape model 𝐌𝐌(𝐩𝐩) by 𝐫𝐫 in Eq. 1 where 𝐩𝐩 (N p × 1) is a vector of variable fitting parameters. We define "parameter" as any number subject to change with the measured system (e.g. the center frequency, homogeneous lifetime, etc.), while the preceding adjectives "constant" or "variable" refer to the status of a parameter during least-squares fitting. For generalized least-squares, the cost function C(𝐩𝐩) (a.k.a. χ 2 ) is equal to the quadratic form in Eq. 2 where 𝐕𝐕 𝐃𝐃 (N D × N D ) is proportional to the data variance-covariance matrix, and superscript 𝐓𝐓 denotes the transpose. In the simplest case of uniform and uncorrelated noise, 𝐕𝐕 𝐃𝐃 is equal to the identity matrix and the cost function C(𝐩𝐩) = |𝐫𝐫| 𝟐𝟐 . For more complicated cases of noise, a detailed discussion of 𝐕𝐕 𝐃𝐃 is provided section B below.