Sampling Distributions
Introduction
The notion of a sampling distribution is one of the most important concepts taught in introductory statistics because it lays down the foundations and motivates the use of hypothesis testing. For instance, in introductory statistics courses, it is common to lear the
RS <- function(nDraws)
{
r <- 1.85
draws <- NULL
nTotal <- nAccept <- 0
repeat
{
nTotal <- nTotal + 1
x <- rnorm(1, 0, sqrt(0.5))
rgx <- r*dnorm(x, 0, sqrt(0.5))
kx <- Kx(x)
if(runif(1, 0, rgx) < kx) {
draws <- c(draws, x)
nAccept <- nAccept + 1 }
if(length(draws) == nDraws) break
}

plot(rnorm(100))
