As said in the main video, the James-Stein estimator takes this form, with this shrinkage factor. So in this video, we want to compute the mean-squared error for the estimator. By definition, the mean-squared error looks like this.
This is just the James-Stein estimator, and mu is the actual means of the p different distributions. And now we start the computation process, which actually isn’t as difficult as I imagined it would be. First, we simply rearrange everything inside the norm.
Now, we separate the expression into two parts, first part we call vector a, and the other vector b. Then we expand everything again. It looks very intimidating, but really, the first term is just norm of a squared, the second one is norm of b squared, and the final one is 2 a dot b.
Now let’s think about each of the terms a little bit more. The first term is just p. In fact, it is just the mean-squared error of the ordinary estimate.
For the second term, we need to do slight manipulation to get (p-2)^2 times the expected value of 1/|X|^2. The final term needs really slight manipulation to get a sum of expectation. This is simply due to linearity of expectation.
So from now on, this is the quantity that we would like to compute. Turns out, we only need to focus on this term. And let’s see what the term with i = 1 will do.
For this term, we have no way but to actually explicitly calculate the expectation, i. e. we really need to do the integration.
This fraction is exactly the thing inside the expectation, and the other part is the probability density function of the normal distribution. But now, there is a trick to calculate this integral. Quite luckily, this is actually the derivative of something.
More precisely, if we were to differentiate the exponential term with respect to x_1, we will get an extra factor of x_1 - mu_1, and a negative sign. So we can use integration by parts to deal with the innermost integral. This part becomes the dv part, and x_1 / |x|^2 becomes the u part.
Using integration by parts, we will get this mess, which will get better. This is the uv part, and this is the vdu part. Now in this first term, as x_1 goes to either infinity, the thing inside will tend to 0, so we can completely ignore this part.
For the other term, we need to differentiate x_1/ |x|^2. And to do that, we just use the quotient rule. You might need a bit of time, but eventually you will get this fraction.
So we can now apply this derivative to change the innermost integral, which will end up looking like this. The boxed expression is just the derivative, which we just calculated. But the remaining part is again the probability density of the normal distribution, which means that this is just another expectation.
The thing inside expectation is precisely the newly calculated derivative. Now previously we calculated this to be the mean-squared error, and what we just did was that when i = 1, then this part can be rewritten as the expectation of some other things. But of course, there is nothing special about 1, in general, you just replace 1 with i.
Then we can use linearity to push the summation into expectation. Then because we are summing up p terms of |X|^2, this will give p times |X|^2, and summing these squares of X_i is exactly the definition of |X|^2, so this gives 2|X|^2. So this whole thing is just (p-2) times the expected value of 1/|X|^2.
Finally, we go back to the original mean-squared error expression, and combine the final two terms and so we get -(p-2)^2 times the expected value of 1/|X|^2. Given that p is just the mean-squared error of the ordinary estimate, and for the James-Stein estimator, we have an extra negative thing, the James-Stein estimator dominates the ordinary estimate. However, there is a bit of a caveat, because of this expectation.
This will highlight the difference between low and high dimensions to make this all work. Let’s examine this in just 1 dimension to start off simple. Written explicitly in terms of the integrals, you might notice there might be a problem with the integrand when x is close to 0.
You can show that in this case, the integral could not converge due to the singularity at 0. What about in 2 dimensions? This part is simply 1/|X|^2, and again this is the probability density of normal distribution.
But now the trick is to change it to polar coordinates, because now, 1/|X|^2 becomes just 1/r^2, and while the p. d. f.
is going to be messy when expressed in polars, the point is that it is just completely smooth. Finally, because of the change of variables, we need to add a factor of r as the Jacobian determinant. However, these two factors contribute 1/r, which again makes the integral not able to converge.
However, in three dimensions, if we use the spherical polar coordinates, then the singularity from 1/r^2, is completely cancelled by the Jacobian factor of r^2 sin theta, and so there is nothing infinite to integrate, and this integral finally converges and actually makes sense! In higher dimensions, that Jacobian factor is made of r^(p-1) times sin of some angles, and so if p is at least 3, then it cancels the singularity from 1/r^2 completely, and so the integral converges. So for the ordinary estimate, the mean-squared error is just p, the dimension of the data, but for the James-Stein estimator, we have this extra term here, which is defined and positive when the dimension is at least 3.
So this is the extra bit to complement the main video. I hope you enjoyed it. See you next time.