15

Addition, subtraction, multiplication and division of normal random variables are well defined, but what about trigonometric operations?

For instance, let us suppose that I'm trying to find the angle of a triangular wedge (modelled as a right-angle triangle) with the two catheti having dimensions $d_1$ and $d_2$, both described as normal distributions.

Both intuition and simulation tell me that the resulting distribution is normal, with mean $\arctan\left(\frac{\text{mean}(d_1)}{\text{mean}(d_2)}\right)$. But is there a way to compute the distribution of the resulting angle? References on where I'd find the answer?

(For a bit of context, I'm working on statistical tolerance of mechanical parts. My first impulse would be to simply simulate the whole process, check if the end result is reasonably normal, and compute the standard deviation. But I'm wondering if there might be a neater analytical approach.)

kjetil b halvorsen
  • 63,378
  • 26
  • 142
  • 467
Bossykena
  • 667
  • 6
  • 11
  • 2
    Could you confirm that (a) d1 and d2 are the side lengths (and not angles); (b) that you are assuming the angle between them is a right angle (for otherwise the atan formula is suspect); and (c) that you are interested in the distribution of one of the other angles of this right triangle? Also, presumably, the SD of each length distribution is much smaller than its expectation because the triangle shouldn't have any appreciable probability of a negative side length :-). – whuber Sep 30 '10 at 19:25
  • Exact. I've rephrased the problem to make it a bit clearer. And yes, the SD will be small relative to the dimensions. – Bossykena Sep 30 '10 at 19:47
  • Using formulas for multiplication and addition, you can try Taylor expansion. –  Sep 30 '10 at 20:04
  • Thanks for both your excellent answers, which (as far as I can tell with my limited stats expertise) are both intuitive and sound. – Bossykena Oct 01 '10 at 18:03

2 Answers2

16

In this interpretation, the triangle is a right triangle of side lengths $X$ and $Y$ distributed binormally with expectations $\mu_x$ and $\mu_y$, standard deviations $\sigma_x$ and $\sigma_y$, and correlation $\rho$. We seek the distribution of $\arctan(Y/X)$. To this end, standardize $X$ and $Y$ so that

$$X = \sigma_x \xi + \mu_x$$ and $$Y = \sigma_y \eta + \mu_y$$

with $\xi$ and $\eta$ standard normal variates with correlation $\rho$. Let $\theta$ be an angle and for convenience write $q = \tan(\theta)$. Then

$$\mathbb{P}[\arctan(Y/X) \le \theta] = \mathbb{P}[Y \le q X]$$

$$=\mathbb{P}[\sigma_y \eta + \mu_y \le q \left( \sigma_x \xi + \mu_x \right)$$

$$=\mathbb{P}[\sigma_y \eta - q \sigma_x \xi \le q \mu_x - \mu_y]$$

The left hand side, being a linear combination of Normals, is normal, with mean $\mu_y \sigma_y - q \mu_x \sigma_x$ and variance $\sigma_y^2 + q^2 \sigma_x^2 - 2 q \rho \sigma_x \sigma_y$.

Differentiating the Normal cdf of these parameters with respect to $\theta$ yields the pdf of the angle. The expression is fairly grisly, but a key part of it is the exponential

$$\exp \left(-\frac{\left(\mu _y \left(\sigma _y+1\right)-\mu _x \left(\sigma _x+1\right) \tan (\theta )\right){}^2}{2 \left(-2 \rho \sigma _x \sigma _y \tan (\theta )+\sigma _x^2+\sigma _y^2+\tan ^2(\theta )\right)}\right),$$

showing right away that the angle is not normally distributed. However, as your simulations show and intuition suggests, it should be approximately normal provided the variations of the side lengths are small compared to the lengths themselves. In this case a Saddlepoint approximation ought to yield good results for specific values of $\mu_x$, $\mu_y$, $\sigma_x$, $\sigma_y$, and $\rho$, even though a closed-form general solution is not available. The approximate standard deviation will drop right out upon finding the second derivative (with respect to $\theta$) of the logarithm of the pdf (as shown in equations (2.6) and (3.1) of the reference). I recommend a computer algebra system (like MatLab or Mathematica) for carrying this out!

whuber
  • 281,159
  • 54
  • 637
  • 1,101
  • 1
    There was never any chance of it being normally distributed. It is an angle! It only takes values on $[-\pi, \pi)$. – Robby McKilliam Oct 01 '10 at 00:06
  • 1
    P(Y/X $\le$ q) = P(Y $\le$ qX) is not correct if X is a normal r.v. - X *can* be negative too. – ronaf Oct 01 '10 at 02:38
  • @ronaf: actually, since $X$ and $Y$ are the side lengths of a physical triangle, we should *not* have negative $X$! – shabbychef Oct 01 '10 at 04:26
  • d'accordo shabbychef! - but you can't eat your cake and have it. if X and Y are normal r.v.s. they will be negative occasionally. perhaps one solution is to think of the triangle as pointing down into the third quadrant if X > 0 but Y < 0 [etc.] in any case, one can still consider the behavior of arctan(X/Y) - which will then range in ($-\frac{\pi}{2}, \frac{\pi}{2}$). – ronaf Oct 01 '10 at 04:49
  • 2
    @ronaf: That's the right idea. If one uses signed side lengths and also considers the angle as a real value (rather than its value modulo $2\pi$), there is no inconsistency with normality in either case. Your point about the inequality possibly being wrong is excellent. All I can do in response is to claim that the equation is an excellent approximation under the assumptions made because the chance of X or Y being negative is negligible. – whuber Oct 01 '10 at 16:01
  • @whuber is the denominator correct for the expression you provided? I feel like it should be something more like $-2\rho\sigma_x \sigma_y \tan \theta + \sigma_x^2 + \sigma_y^2 \tan^2\theta$ Also is there a reference you can recommend for the expression you provided? – jkt Apr 12 '19 at 17:05
  • 1
    @YBE I agree that the last "+" in my expression looks like it doesn't belong--it might have slipped in when I was cleaning up the TeX markup. I don't have a reference because I computed the derivative myself. – whuber Apr 12 '19 at 17:59
14

You are looking at circular statistics and in particular a circular distribution called the projected normal distribution.

For some reason this topic can be a little hard to google, but the two major texts on circular statistics are The Statistical Analysis of Circular Data by Fisher and Directional Statistics by Mardia and Jupp.

For a thorough analysis of the projected normal distribution see page 46 of Mardia and Jupp. There are closed form expressions (up to the error function integral) for the distribution, and as whuber has suggested, it looks similar to the normal when its `variance' (careful here, what does variance mean for a random variable on a circle?!) is small, i.e. when the distribution is quite concentrated at one point (or direction or angle).

whuber
  • 281,159
  • 54
  • 637
  • 1,101
Robby McKilliam
  • 2,010
  • 14
  • 14