Positive-part James-Stein estimator \(\hat\theta_i = t + c (X_i - t)\),
\(c = \max(0, 1 - k \sigma^2 / \sum_i (X_i - t)^2)\), with \(k = p - 2\)
for a fixed target \(t\) and \(k = p - 3\) when the target is the
grand mean estimated from the same data (Efron and Morris). Identical to
the Python arm morie.fn.jamste.james_stein.
Value
A list with value (the shrinkage factor), p,
target, k, sigma2, shrinkage_factor,
js_estimates, original_means and
mse_reduction_bound.
References
James, W. and Stein, C. (1961). Estimation with quadratic loss. Proceedings of the Fourth Berkeley Symposium 1, 361-379.
Efron, B. and Morris, C. (1975). Data analysis using Stein's estimator and its generalizations. Journal of the American Statistical Association 70, 311-319.
Examples
james_stein(c(10, -5, 3, 0.1, -2))$value
#> [1] 0.9846823
