0
$\begingroup$

I hope I can get some help to understand step by step calculations for formulas below.

If I have a weighted distance formula like below:

$d(O, P) = \sqrt{\frac{\hat{x_1^2}}{\hat{s_{11}}} + \frac{\hat{x_2^2}}{\hat{s_{22}}}}$ ---- eq 1.

And I have rotated my axes by $\theta$s and got new axes like below:

$\hat{x_1} = x_1cos(\theta) + x_2sin(\theta)$

$\hat{x_2} = -x_1sin(\theta) + x_2cos(\theta)$

Then, I get a distance formula like below by sustituting $\hat{x_1}$ and $\hat{x_2}$ in eq 1.:

$d(O, P) = \sqrt{a_{11}x_1^2 + 2a_{12}x_1x_2 + a_{22}x_2^2}$

And in my book, $a_{11}$ is calculated like below: $a_{11} = \frac{cos^2(\theta)}{cos^2(\theta)s_{11} + 2sin(\theta)cos(\theta)s_{12}+sin^2(\theta)s_{22}} + \frac{sin^2(\theta)}{cos^2(\theta)s_{22} - 2sin(\theta)cos(\theta)s_{12}+sin^2(\theta)s_{11}} $

In the book, it says that $a_{11}, a_{12}$ and $a_{22}$ are determined by the angle $\theta$ and $s_{11}, s_{12}$, and $s_{22}$ calculated from the original data. Additionally, $s_{11}, s_{12}$, and $s_{22}$ are variances and co-variance($s_{12}$).

My question here is to understand how the calculations are done. Can you please tell me how all the calculations done here.

$\endgroup$

1 Answer 1

1
$\begingroup$

Start from \begin{align} d(O, P) = \sqrt{\frac{\hat{x_1^2}}{\hat{s_{11}}} + \frac{\hat{x_2^2}}{\hat{s_{22}}}}. \end{align} You want to convert that to

\begin{align} d(O, P) = \sqrt{a_{11}x_1^2 + 2a_{12}x_1x_2 + a_{22}x_2^2} \end{align} and work out the values of the $a_{ij}$. To do so, I'll show that the things under the square roots are equal, that is, I'll show how to go from

\begin{align} e_1 = {\frac{\hat{x_1^2}}{\hat{s_{11}}} + \frac{\hat{x_2^2}}{\hat{s_{22}}}}. \end{align} to \begin{align} e_2 = {a_{11}x_1^2 + 2a_{12}x_1x_2 + a_{22}x_2^2} \end{align} We've got a substitution, \begin{align} \hat{x_1} &= x_1\cos(\theta) + x_2\sin(\theta)\\ \hat{x_2} &= -x_1\sin(\theta) + x_2\cos(\theta) \end{align} I'm going to replace $\sin(\theta)$ and $\cos(\theta)$ with the letters $s$ and $c$ to make things shorter and simpler; I'll replace them back at the end. So we have \begin{align} \hat{x_1} &= c x_1 + s x_2\\ \hat{x_2} &= -s x_1+ c x_2 \end{align} which I'll call the "main substitution" Now let's get to work. \begin{align} e_1 &= \frac{\hat{x_1^2}}{\hat{s_{11}}} + \frac{\hat{x_2^2}}{\hat{s_{22}}}\\ &= \frac{(c x_1 + s x_2)^2}{\hat{s_{11}}} + \frac{(-s x_1+ c x_2)^2}{\hat{s_{22}}} \text{, by the main substitution}\\ &= \frac{c^2 x_1^2 + 2cs x_1 x_2 + s^2 x_2^2}{\hat{s_{11}}} + \frac{s^2 x_1^2 -2cs x_1 x_2 + c^2 x_2^2}{\hat{s_{22}}} \end{align} where that last step used the rules \begin{align} (P+Q)^2 &= P^2 + 2PQ + Q^2, and \\ (P-Q)^2 &= P^2 - 2PQ + Q^2. \end{align}

Now in that last expression, let's gather together the terms involving $x_1^2$, $x_1 x_2$, and $x_2^2$. We get: \begin{align} e_1 &= \frac{c^2 x_1^2 + 2cs x_1 x_2 + s^2 x_2^2}{\hat{s_{11}}} + \frac{s^2 x_1^2 -2cs x_1 x_2 + c^2 x_2^2}{\hat{s_{22}}}\\ &= \frac{c^2 x_1^2 }{\hat{s_{11}}} + \frac{ 2cs x_1 x_2}{\hat{s_{11}}}+\frac{ s^2 x_2^2}{\hat{s_{11}}} + \frac{s^2 x_1^2 }{\hat{s_{22}}} -\frac{2cs x_1 x_2 }{\hat{s_{22}}}+\frac{c^2 x_2^2}{\hat{s_{22}}}\\ &= \frac{c^2 x_1^2 }{\hat{s_{11}}} + \frac{s^2 x_1^2 }{\hat{s_{22}}}+ \frac{ 2cs x_1 x_2}{\hat{s_{11}}}-\frac{2cs x_1 x_2 }{\hat{s_{22}}}+\frac{ s^2 x_2^2}{\hat{s_{11}}} +\frac{c^2 x_2^2}{\hat{s_{22}}}\\ &= \left(\frac{c^2 }{\hat{s_{11}}} + \frac{s^2 }{\hat{s_{22}}}\right) x_1^2 + \left( \frac{ 2cs }{\hat{s_{11}}}-\frac{2cs }{\hat{s_{22}}}\right) x_1x_2+\left(\frac{ s^2 }{\hat{s_{11}}} +\frac{c^2 }{\hat{s_{22}}}\right) x_2^2\\ \end{align}

At this point, I'm hindered by not having an expression for $\hat{s_{11}}$ in terms of $\hat{s_{ij}}$, and I'm not quite willing to read blurry rotated pages to find it. But if you DO find that expression, and substitute it (and the corresponding one for $\hat{s_{22}}$ into the first term of my last expression, I'll bet it'll simplify nicely to the expression given for $a_{11}$.

$\endgroup$
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .