|
From: Daniel H. <vi5...@ya...> - 2017-12-10 17:09:54
|
Am 28.11.2017 um 00:34 schrieb Dan via gnuplot-info:
>> - in the variable L_err, the value (presumably calculated in a
>> finite-difference way) of
>> \sqrt{\frac{2}{\left(\partial\!^{2}\!\left(\chi^2\right)/\partial
>> L\!^{2}\right)_{L = l,M =
>> m}-\left(\left(\partial\!^{2}\!\left(\chi^2\right)/\left(\partial\!\!L\!\partial\!\!M\right)\right)_{L
>> = l,M = m}\right)^2/\left(\partial\!^{2}\!\left(\chi^2\right)/\partial
>> M\!^{2}\right)_{L = l,M = m}}}
On Saturday, 2 December 2017, 17:35, Hans-Bernhard Bröker <HBB...@t-...> wrote:
> The algorithm never actually computes it just like that. What actually
> happens is that the code builds a matrix of all the second partial
> derivatives of \chi^2 with respect to the given parameters. This
> matrix is inverted, to yield the covariance matrix. The roots of the
> diagonal elements of that matrix form the error values. These get
> divided out of each column and row, to form the correlation matrix that
> is printed out.
> For the special case of just two parameters the formulae you found may
> well be correct... I didn't compute it through to check one way or the
> other.
No worries: you'd given me enough information that I could turn the handle on the formula for the inverse of a 2\times 2 matrix myself. I can confirm that the formula, which I originally conjectured was used to provide the value that Gnuplot puts in the variable L_err, is indeed the square root of twice the "LL" diagonal element of the inverse of the Hessian of \chi^2, evaluated at the L and M values that minimize \chi^2. That matches your description of what's going on except for the "twice". (And similarly for M_err).
Similarly, the formula, which I originally conjectured was used to provide the value that Gnuplot puts in the variable FIT_COV_M_L, is minus twice (either one of) the off-diagonal element(s) of the inverse of the Hessian of \chi^2, evaluated at the L and M values that minimize \chi^2. That matches your description of what's going on except for the "minus twice", and the fact that my formula hadn't had the diagonal elements 'divided out of each column and row' (but the latter may just be because I'd done "set fit noerrorscaling"). Incidentally, something I'd already observed is that the value that gets stored in FIT_COV_M_L is not the same as the off-diagonal element of the "covariance matrix" that gets printed to the screen at the end of the fit process.
> There's really nothing special about that method. It's basically the
> definition of what all fitting tools do for asymptotic error estimation.
> They're "asymptotic" because they're derived from the second
> derivatives, i.e. just lowest-order term describing the shape of the
> \chi^2 function "landscape" near the discovered minimum
On the contrary, there's something _very_ special about it - namely that, if one gets the detailed handle-turning right, the integral over all (parameter) space that formally defines the standard error belongs to a class of problems whereby there is a rigorous upper bound on the magnitude of the error of (one particular variant of) the method based on the second derivatives evaluated at the discovered minimum, when used as an approximation to that integral (see Olver, 1997, _Asymptotics and special functions_, CRC Press, Boca Raton, section 3.7). The reason I keep prodding away about published sources is that I'd like to confirm that I _have_ got the detailed handle-turning right by finding someone else who's done it (and preferably got it through peer review).
|