# Hypothesis test on the Euclidean length of an unknown vector

## Question

Suppose I observe a vector $\mathbf{x}=[X_1 \ldots X_n]$, where each $X_i=m_i+n_i$, with $n_i$ being an independent zero-mean Gaussian random variable with variance $\sigma^2$ (i.e. $n_i\sim\mathcal{N}(0,\sigma^2)$ i.i.d.) and $\mathbf{m}=[m_1 \ldots m_n]$ is an unknown vector with a known Euclidean length to the origin $l(\mathbf{m})=\|\mathbf{m}\|_2=\sqrt{\sum_{i=1}^n m_i^2}$.

Suppose that the Euclidean length of the unknown vector $\mathbf{m}$ can equally likely be either $l_0$ or $l_1$, and, without loss of generality, $l_0<l_1$. Now, given the vector of noisy observations $\mathbf{x}$ I need to decide whether the length of $\mathbf{m}$ is $l_0$ or $l_1$. Note that I do not know (nor do I need to know for my answer) the values in $\mathbf{m}$, just the two possibilities for length.

The intuitive procedure is to compute the Euclidean length of the observed vector $S=\sqrt{\sum_{i=1}^nX_i^2}$, and then select whichever of $l_0$ or $l_1$ is closer to $S$ (based on some threshold that is related to the probabilities of error that you are willing to tolerate). Since $S^2$ is a non-central chi-square random variable, one can (numerically) obtain (at least bounds) on the probabilities of error of this approach.

However, is $S$ the "best" test statistic (in the sense of Neyman-Pearson optimality) for this problem? If it is not optimal, is a better test known? If $S$ is optimal, is there a proof of its optimality in the literature?

## My prior effort

This seems like a problem that should be well-studied. In fact, it is related to the problem of non-coherent detection in communications theory, where $S^2$ is used by the square-law detector. John Proakis has a proof on pages 304-306 of "Digital Communications" (4th edition) that $S$ as defined is the N-P test statistic for when $n=2$ (detection of a complex-valued symbol with arbitrary phase offset). He essentially projects the problem into polar coordinate system, and takes the expectation of the test statistic over the uniform distribution for the angle.

I tried a naive approach of extending Proakis' proof to $n$-spherical coordinate system (since $\mathbf{m}$ can be thought of a coordinate on an $n$-sphere with radius $l_k$) and computing the likelihood function (from N-P) by taking the expectation over the uniform distribution on all the angles. However, while I can get a closed form expression $n=3$ which yields the N-P test statistic defined by $S$, the integration gets really nasty for $n>3$. Perhaps there is something more clever that one can do, maybe using the circular symmetry of joint distribution of i.i.d. Gaussians.

This question is related to my previous question.

• +1. Some fine points: (1) $S^2$ has the (noncentral) chi-square distribution, not $S$. (2) You seem implicitly to assume the two conditional distributions $m|l_i$ are uniform over the sphere(s). Because this does not mean uniform "on all the angles," I just want to make sure of your assumptions. (3) Why do you invoke N-P in a setting that is Bayesian? After all, you have well-determined priors on $m|l$ and $l=(l_0,l_1)$. So why doesn't the posterior distribution of $l|x$ fully answer your question?
– whuber
Apr 17 '13 at 13:58
• @whuber Thanks for your comment. (1) was a typo, I fixed that; (2) I was basically extending the Proakis' proof on on the complex plane to an $n$-sphere. In his proof, under known magnitude of the vector, he analyzes the worst case for the detector, which is when the phase is distributed uniformly at random. I was under the impression that I could extend that to an $n$-sphere by assuming that all $n-1$ angles ("phases") are distributed uniformly at random on $[0,\pi]$ for the first $n-2$ of them and on $[0,2\pi]$ for the remaining one. Is that incorrect? Apr 18 '13 at 2:52
• @whuber And for (3), yes, the posterior distribution of $l|x$ would answer my question (since the priors on $\{l_0,l_1\}$ are indeed well-defined), however, I do not know how to write it down. This is why I've been trying to figure out the likelihood function $p(x|l)$. Do you have any ideas on what $p(l|x)$ is in this problem? Apr 18 '13 at 3:06
• Thanks for your replies. A uniform distribution on the sphere $S^n$ for $n\ge 2$ is not a uniform distribution on the angles. For example, on the two-sphere $S^2$ the distribution is uniform in the longitude (from $0$ to $2\pi$) but uniform in the sine of the colatitude (from $0$ to $\pi$). One way to handle that is to assume independent standard Normal distributions for all coordinates in $\mathbb{R}^{n+1}$ and ignore the radial part. See stats.stackexchange.com/questions/7977.
– whuber
Apr 18 '13 at 5:29
• @whuber Thank you, this is very interesting. I think I understand that joint iid Normal yields uniform distribution on surface of a sphere (from your last comment's link, also circular symmetry), however, I think I need the "converse" for this problem (see my question on MSE: math.stackexchange.com/questions/362874/…). So, I am confused by "One way to handle that is to assume independent standard Normal distributions for all coordinates in $\mathbb{R}^{n+1}$ and ignore the radial part." Could you please elaborate? Apr 18 '13 at 6:47