In a report I am reading at work, the error matrix is calculated as the inverse of the hessian matrix and used to calculate the error ellipse angle and axes with a not theoretically correct formula.

They start from a function of 2 variables: $f=f(x, y)$ (I won't use the real function, for the purpose of the question a generic one should be enough) and calculate the hessian matrix:

$$ H = \begin{pmatrix} \partial^2_x f & \partial_x \partial_y f \\\\ \partial_y \partial_x f & \partial^2_y f \end{pmatrix} $$

and the error matrix as its inverse:

$$ E = H^{-1} = \begin{pmatrix} E_{xx} & E_{xy} \\\\ E_{yx} & E_{yy} \\ \end{pmatrix} $$

Written in this way it seems to me that the error associated to the variable $x$ is the one located in position $E[0, 0]$, but if I calculate explicitly the inverse of the hessian:

$$ H^{-1} = \frac{1}{\mid H\mid} \begin{pmatrix} \partial^2_y f & -\partial_x\partial_y f \\\\ -\partial_y\partial_x f & \partial^2_x f \\ \end{pmatrix} $$

the term in position $[0, 0]$ is something related to the $y$ variable and not $x$.

And finally the error matrix is used to calculate the orientation of the error ellipse, $\vartheta$, and the size of the major ($e_1$) and minor ($e_2$) axes with the not theoretically correct formula:

$$ \tan{\vartheta} = \frac{E_{xy}}{E_{xx}} $$

$$ e^2_1 = \frac{E^3_{yy} + E^2_{xy} (2E_{yy} + E_{xx}) }{E^2_{xy} + E^2_{yy} } $$

$$ e^2_2 = \frac{E_{yy}( E_{xx} E_{yy} - E^2_{xy}) }{E^2_{xy} + E^2_{yy} } $$

Now I am confused on what the elements of the error matrix are.

Of course call something $x$ or $y$ is just a convention, but when the error matrix is calculated as inverse of the hessian matrix, its first line is associate to which variable? $x$ or $y$? I.e. is $E_{xx}$ the variance related to the $x$ even if contain term related to the $y$ variable, or it is the $y$ variance?

Did anyone see these equations before and know where I can find any info about them? I couldn't find them anywhere, I always used the eigenvalues and eigenvectors of the matrix never this approximated formula.

I know these are questions to the people who wrote this report, but they are gone leaving just this really confusing document and I don't have anyone else to ask.

  • 1
    $\begingroup$ Re "the term in position [0,0] is something related to the y variable and not x." Not so. That term usually does depend on $x;$ moreover, you have neglected the division by $|H|,$ which explicitly depends on $x.$ Re "ever see these equations before": this is called the Fisher Information matrix. $\endgroup$
    – whuber
    Commented Sep 1, 2022 at 13:02
  • $\begingroup$ @whuber thanks for you comment, I will check the Fisher Information matrix better. Yes you are right, of course the $|H|$ depends on $x$. When I asked if anyone saw these equations I meant the equations for the ellipse angle, the major and the minor axes, I always calculated them using the eigenvalues and eigenvectors of the error matrix. The ones in the report seems to me some sort of strange approximation that I don't recognise. $\endgroup$ Commented Sep 1, 2022 at 16:06
  • $\begingroup$ Thank you for the clarification. You can obtain those angles in several ways. Two geometric solutions are indicated in my discussion of ellipses at stats.stackexchange.com/a/71303/919, although i do not stop to write them down (that wasn't the focus of the thread). The formulas you quote look like long-winded renditions of the matrix formulas. $\endgroup$
    – whuber
    Commented Sep 1, 2022 at 17:41
  • 1
    $\begingroup$ @whuber thanks a lot for your help, that's a really interesting. $\endgroup$ Commented Sep 2, 2022 at 7:37


Browse other questions tagged or ask your own question.