# Scale Parameter of Rayleigh Distribution

As seen in the cdf of the Rayleigh distribution below, we have a mysterious "scale parameter" $\sigma$:

$$F(x, \sigma)=1-e^{-x^2/\sigma^2}$$

For identically distributed random variables $x_i$, the wikipedia page offers an approximation to this scale parameter as follows:

$$\hat{\sigma}\approx\sqrt{\frac{1}{N}\sum_{i=1}^{N}{}x_i^2}$$

This is a good approximation, and they show an exact calculation for $\sigma$, though it involves some gamma functions that are hard to follow.

Where I'm coming across this is in using some complex data representing radar images, where the distribution of real and imaginary components will have close, though not identical distributions (as in the variance of real components vary slightly from the variance of imaginary components. Or either is skewed slightly, or not exactly 0-mean. We live in an imperfect world). We'll call each complex sample $z_i$.

Deriving an equation from the code, I found my company calculates this scale parameter as follows: $$\sigma^2=\frac{ \sum_{i=0}^{N-1}{(|z_i|-\mu)^2} -\frac{1}{N} [\sum_{i=0}^{N-1}{(|z_i|-\mu)}]^2 }{N-1}$$ For some mean of the magnitudes $\mu$, and with $N$ complex samples. It seems to give a good if not better calculation of the scale parameter above (from what I tested in Python and C). It is noted that they call this parameter the "variance" of the data.

Their formula looks similar to the traditional variance calculation. $$\textrm{Var}[Z]=E[|Z|^2]-|E[Z]|^2$$ However, my company's equation takes the expected value of the difference of the magnitude and mean, rather than just taking the expected value of the magnitude of the data.

Can anyone point me to literature for such an equation for $\sigma^2$, if it is even a valid equation? Or show how it is derived? Is it even a legitimate equation? There is a chance we are just finding the scale parameter wrong.

I would get the answer from within the company, though the original designer is long gone and I'm considered the "expert" on this section. I've tried asking individuals but got a look of confusion similar to my own.

Any help would be appreciated, and thanks in advance!

• Even before talking about estimates, could you clarify what the theoretical model is for your complex number $Z$ (sampled as $z_i$)? Usually Rayleigh distribution is used as the radial density, which should be accompanied by an angular distribution. That is, in polar coordinates. However, you said the real part $X$ and imaginary part $Y$ of $Z$, as in $Z = X + i Y$, have similar yet non-identical distributions. That's in Cartesian coordinates. How does Rayleigh play a part in this? – Lee David Chung Lin Jun 3 '18 at 0:57
• Also, there's nothing mysterious about the scale parameter $\sigma$ in Rayleigh. If $X$ and $Y$ have iid Gaussian with mean of zero and variance of $\sigma^2$, then $R \equiv \sqrt{X^2+Y^2}$ has Rayleigh density. The $\sigma$ in Rayleigh is by definition the $\sigma$ of the underlying Gaussian. If $X$ and $Y$ started out not identical or non-Gaussian, then you don't even have Rayleigh. So at this point your question doesn't make much sense to me. – Lee David Chung Lin Jun 3 '18 at 1:10
• @LeeDavidChungLin Thanks for the reply and sorry for not being clear. We are dealing with radar image signals. When a sample of pulse is represented in complex values, both real and imaginary components are roughly 0-mean Gaussian distributed. Therefore, when taking the magnitude of a pulse, the data is roughly Rayleigh distributed. This is actual data, so its not exactly Rayleigh distributed, but we operate under that assumption. As for the use of the words "coordinates", I'm probably just using the wrong terminology. I view a lot of math visually, and that goes for complex for numbers. – Clint Chelak Jun 5 '18 at 4:00
• @LeeDavidChungLin As for the question, I suspect the previous developer is incorrectly finding $\sigma$, though the results of his equation seems to be functioning "correctly" (as in, when I find the variance of real then imaginary components together, then average the two, it is almost identical to to the "variance" equation he created above for all data samples I've tried). I can't find his equation in literature, however, and I was wondering if someone knew of its source. If not, could someone derive his equation or disprove it? – Clint Chelak Jun 5 '18 at 4:05

The limits of the summation can be dropped since you are summing over the entire sample of $N$ observations. Let's use $k$ as the summation index to avoid clash with $i = \sqrt{-1}$.

Your given formula is $\widehat{ \sigma^2 }=\frac1{N-1} \left( \sum{(|z_k|-\mu)^2} -\frac{1}{N} \left[\sum{(|z_k|-\mu)} \right]^2 \right)$. Just expand the terms and watch them cancel.

\begin{align*} (N-1)\widehat{ \sigma^2 } &= \sum\left(|z_k|^2 - 2\mu|z_k| + \mu^2 \right) -\frac{1}{N} \left[ -N \mu + \sum|z_k| \right]^2 \\ &= \sum|z_k|^2 - \color{blue}{2\mu \sum|z_k|} + \color{magenta}{N\mu^2 } -\frac{1}{N} \left[ \color{magenta}{ N^2 \mu^2 } - \color{blue}{ 2N \mu\sum|z_k|} + \left(\sum|z_k|\right)^2 \right] \\ &= \sum|z_k|^2 - \frac1N \left(\sum|z_k|\right)^2 \\ \end{align*}

Thus for large enough $N$ this $\widehat{ \sigma^2 }\,$is the same as the ordinary (not-so-good) sample variance, where we treat $$\frac1{N (N-1)} \left(\sum|z_k|\right)^2 \approx \left(\frac{ \sum|z_k| }N\right)^2$$ as the estimate for the square of sample mean.

Anchoring at an auxiliary $\mu$ is a common maneuver to decompose the variance (total variation), which can be conceptually useful. Nonetheless, this theoretical motivation doesn't apply here.

My personal guess is this: in terms of computation, shifting by this arbitrary $\mu$ might provide some numerical stability (guard against round-off error, etc) if $|z_i|$ is typically very small when $\sigma$ is moderately small. It all depends on the actual data.

Also note that this has absolutely nothing to do with any of the following:

1. $|z_k|$ being non-negative
2. $z_k = x_k + i y_k$ being complex
3. $x_k$ and $y_k$ being non-identical and non-Gaussian with demonstrable skewness.
4. Rayleigh distribution
• Thanks for this, and thanks for sticking with me through this. This was an excellent reply and what I was looking for. I'd give more one-ups if I could. – Clint Chelak Jun 6 '18 at 15:51
• @ClintChelak Glad I could help. I merely stated what that formula does, and in fact there are more issues if you think about. The real problem is how you should model the radar data, which I have no experience of. – Lee David Chung Lin Jun 6 '18 at 16:30