jamestein {mcsm} | R Documentation |
This is a Monte-Carlo representation of the risks of some James-Stein estimators of the mean theta of a p-dimensional N(theta,I) distribution, taking advantage of a variance reduction principle based on recycling random variates.
jamestein(N = 10^3, p = 5)
N |
Number of simulations |
p |
Dimension of the problem |
Given that the risk is computed for all values of the mean theta, using a different normal sample for each value of theta creates an extraneous noise that is unecessary. Using the same sample produces a smooth and well-ordered (in the shrinkage parameter a) set of graphs.
Returns a plot with 10 different values of the shrinkage factor a between 1 and 2*(p-2), which is the maximal possible value for minimaxity.
Because of the multiple loops used in the code, this program takes quite a while to produce its outcome. Note that there is a James-Stein effect only when p>2 but that it may not be visible for a small value of N.
Christian P. Robert and George Casella
Chapter 4 of EnteR Monte Carlo Statistical Methods
jamestein(N=2*10^2) #N is too small to show minimaxity