Is the median confidence value an unbiased MLE? I have done extensive monte carlo simulations which have validated the following statements:


*

*Given a sample of N independent and identically distributed Rayleigh random variables $x_i$ with parameter $\sigma$, then $\widehat{\sigma^2}\approx \!\,\frac{1}{2N}\sum_{i=1}^N x_i^2$ is an unbiased maximum likelihood estimate.

*(Formally, from Siddiqui 4.10:) The confidence interval for that estimate comes from $\frac{N\overline{x^2}}{\chi^2 (2N)}$
Given these two statements, then is the median of the second distribution an unbiased MLE for $\sigma^2$?
I have checked some examples and found the median (50% quantile) given by (2) to match the proper MLE given in (1), but only to two significant figures.  Is the difference between these two estimators significant?  And if so, why does it exist?  (E.g., is there a correction factor that would make them match exactly?)
 A: From an i.i.d. sample of Rayleigh r.v.'s we obtain the MLE/Method of Moments estimator
$$\hat \sigma^2_{MLE} = \frac{1}{2N}\sum_{i=1}^n x_i^2 \implies 2\hat \sigma^2_{MLE} = \frac{1}{n}\sum_{i=1}^n x_i^2$$
We see that the right hand side is the sample mean of the squared Rayleighs... and we can easily deduce by the change-of-variables formula that if $X$ follows a Rayleigh distribution with parameter $\sigma$, then the random variable $Z = X^2$ follows an Exponential distribution with scale parameter $\gamma = 2\sigma^2$.
A confidence interval for the mean of an Exponential distribution depends on the sum of the i.i.d exponentials, and the sum of i.i.d. $\sum^n Exp(\gamma) \sim Gamma(n, \gamma)$ (shape-scale paramaterization).
$$\frac{2n\bar Z}{\chi^2_{1-\frac{\alpha}{2},2n}} < \gamma < \frac{2n\bar Z}{\chi^2_{\frac{\alpha}{2},2n}} \implies \frac{2}{\chi^2_{1-\frac{\alpha}{2},2n}}\cdot Gamma(n,\gamma) < \gamma < \frac{2}{\chi^2_{\frac{\alpha}{2},2n}}\cdot Gamma(n,\gamma)$$
Since $\gamma /2 = \sigma^2$ we obtain
$$\left(\chi^2_{1-\frac{\alpha}{2},2n}\right)^{-1}\cdot Gamma(n,2\sigma^2) < \sigma^2 < \left(\chi^2_{\frac{\alpha}{2},2n}\right)^{-1}\cdot Gamma(n,2\sigma^2)$$
We have no closed form for the median $m$ of a Gamma distribution, but the Gamma becomes almost symmetric rather quickly, as the shape parameter increases in value (here equal to the sample size $n$). So the median will be almost equal to its mean, say $\mu$, which here is equal to  
$$m_l \approx \mu_l = \frac{2n\sigma^2}{\chi^2_{1-\frac{\alpha}{2},2n}},\;\;\;m_u \approx \mu_u = \frac{2n\sigma^2}{\chi^2_{\frac{\alpha}{2},2n}}$$
for the lower and upper bound of the confidence interval respectively.
Now, as $n$ increases one can verify that both quantiles of the chi-squared distribution approach the degrees of freedom, here $2n$ (this happens because the chi-squared distribution becomes very concentrated around its mean value as the degrees of freedom increase),
$$n \uparrow  \implies m_l, m_u \approx \sigma^2$$
So, using $\hat \sigma^2$ as the parameter instead of the unknown true value, we see why the median of this distribution is close to the MLE.
The approximate formula for the median of a $Gamma (k,\theta)$ distribution is
$$m \approx k\theta\cdot \frac{3k -0.8}{3k+0.2}$$
which in our case becomes
$$m_l \approx \mu_l\frac{3n -0.8}{3n+0.2},\;\;\; m_u \approx \mu_u\frac{3n -0.8}{3n+0.2}$$
