Announcements

Bias

Mean squared error

Bias-variance tradeoff

Multiple parameters

Normal means and Stein’s paradox

p = 100
JS <- function(x) max((1 - (p-2)/sum(x^2)),0) * x
mu = sample(c(1:5), p, replace = TRUE)
mu
##   [1] 3 5 2 3 4 1 4 4 5 5 3 3 4 3 3 2 5 1 2 2 4 4 1 5 1 5 4 5 4 3 3 5 4 4 3
##  [36] 5 1 3 2 5 4 1 2 5 1 2 5 1 3 1 4 4 1 2 4 3 2 4 1 5 5 5 1 1 4 3 4 2 5 3
##  [71] 5 5 4 4 5 2 4 1 3 4 3 2 4 2 5 3 3 1 4 5 2 1 3 4 2 4 2 3 2 2
SEs <- replicate(10000, sum(((rnorm(p) + mu) - mu)^2))
JSSEs <- replicate(10000, sum(((JS(rnorm(p) + mu)) - mu)^2))
mean(SEs)
## [1] 99.88886
mean(JSSEs)
## [1] 92.44216