\documentclass[12pt]{article}
\usepackage{times}
\setlength{\textwidth}{6.3in}
\setlength{\textheight}{8.5in}
\setlength{\topmargin}{-0.5in}
\setlength{\oddsidemargin}{0in}
\setlength{\evensidemargin}{0in}

\newcommand{\cs}{, \;\;}                     % comma, space
\newcommand{\half}{\frac{1}{2}}              % 1/2
\newcommand{\Var}{\mbox{Var}}
\newcommand{\Cov}{\mbox{Cov}}
\pagestyle{empty}

\begin{document}
\parindent0pt
\parskip1ex

\centerline{\bf \large Confidence Ellipsoids for Bivariate Normals}

Consider random variables $[X_1 \; X_2]^T \sim N([\mu_1 \; \mu_2]^T, \Sigma)$ where
$\Sigma=\left[\begin{array}{cc} \sigma_1^2 & \sigma_{12} \\ \sigma_{12} & \sigma_2^2 \\ \end{array}\right].$

\begin{eqnarray*}
  f(X)&=&\left( 2\pi|\Sigma| \right)^{-\half}
         \exp\left(-\half [X_1-\mu_1 \; X_2-\mu_2] \; \Sigma^{-1}
          \left[ \begin{array}{c} X_1-\mu_1 \\ X_2-\mu_2 \\ \end{array} \right] \right) \\
  \Sigma^{-1} &=& \left[\begin{array}{cc} \sigma_2^2/|\Sigma| & -\sigma_{12}/|\Sigma| \\\
                                          -\sigma_{12}/|\Sigma| & \sigma_1^2/|\Sigma| \\ \end{array}\right] 
                   \\
  |\Sigma| &=& \sigma_1^2\sigma^2-\sigma_{12}^2  \\
  f(X)&=&\left( 2\pi|\Sigma| \right)^{-\half}
    \exp\left(\frac{-1}{2|\Sigma|}
               \left[ \begin{array}{c c} \sigma_2^2(X_1\!-\!\mu_1)-\sigma_{12}(X_2\!-\!\mu_2), \;  
                          \sigma_1^2(X_2\!-\!\mu_2)-\sigma_{12}(X_1\!-\!\mu_1) \\ \end{array} \right]
  \left[ \begin{array}{c} X_1\!-\!\mu_1 \\ X_2\!-\!\mu_2 \\ \end{array} \right] \right) \\
    &=& \left( 2\pi|\Sigma| \right)^{-\half} \exp\left( \frac{-1}{2|\Sigma|} 
           \left[ \sigma_2^2(X_1\!-\!\mu_1)^2 + \sigma_1^2(X_2\!-\!\mu_2)^2 
           - 2\sigma_{12}(X_1\!-\!\mu_1)(X_2\!-\!\mu_2)  \right] \right) \\
\end{eqnarray*}

For a confidence ellipsoid defined by $k$, $X_2$ coordinates at $X_1=x_1$ are solutions of
$$
k=\sigma_1^2X_2^2+(2\sigma_{12}\mu_1-2\sigma_1^2\mu_2-2\sigma_{12}x_1)X_2+
    \left[ \sigma_2^2x_1^2 -2\sigma_2^2\mu_1x_1+2\sigma_{12}\mu_2x_1 \right] \\
$$

$X_2$ coordinates for ``tips'' of the ellipsoid for constant $k$ are
$$ X_2=\frac{-(2\sigma_{12}\mu_1-2\sigma_1^2\mu_2-2\sigma_{12}\hat{x}_1)} {2\sigma_1^2}
  = \mu_2+\frac{\sigma_{12}}{\sigma_1^2}\left(\hat{x}_1-\mu_1\right) $$
where $\hat{x}_1$ is the solution to:
\begin{eqnarray*}
0&=&(2\sigma_{12}\mu_1-2\sigma_1^2\mu_2-2\sigma_{12}x_1)^2-4\sigma_1^2 \left[ \sigma_2^2x_1^2 -2\sigma_2^2\mu_1x_1+2\sigma_{12}\mu_2x_1 -k \right] \\
0&=&(4\sigma_{12}^2-4\sigma_1^2\sigma_2^2)x_1^2 +
     (8\sigma_1^2\sigma_{12}\mu_2-8\sigma_{12}^2\mu_1+8\sigma_1^2\sigma_2^2\mu_1-8\sigma_1^2\sigma_{12}\mu_2)x_1 \\
     &+&(4\sigma_{12}^2\mu_1^2+4\sigma_1^4\mu_2^2-8\sigma_{12}\sigma_1^2\mu_1\mu_2+4\sigma_1^2k)\\
\end{eqnarray*}

So for a given $k$, 
\begin{eqnarray*}
\hat{x}_1 &=& \frac{- (8\sigma_1^2\sigma_{12}\mu_2-8\sigma_{12}^2\mu_1+8\sigma_1^2\sigma_2^2\mu_1-8\sigma_1^2\sigma_{12}\mu_2)
                \pm\sqrt{q}}
              {8\sigma_{12}^2-8\sigma_1^2\sigma_2^2}
\end{eqnarray*}
where
$q=(8\sigma_1^2\sigma_{12}\mu_2-8\sigma_{12}^2\mu_1+8\sigma_1^2\sigma_2^2\mu_1-8\sigma_1^2\sigma_{12}\mu_2)^2-4(4\sigma_{12}^2-4\sigma_1^2\sigma_2^2)
     (4\sigma_{12}^2\mu_1^2+4\sigma_1^4\mu_2^2-8\sigma_{12}\sigma_1^2\mu_1\mu_2+4\sigma_1^2k)$

For any given $k$, the area inside the ellipsoid can be calculated by constructing a grid between the
two values of $\hat{x}_1$ and then summing the density over a grid over the range of $X_2$.

\end{document}



