Skip to content

Instantly share code, notes, and snippets.

@sieste
Last active January 28, 2020 16:18
Show Gist options
  • Save sieste/d1b3b50fb735204e0a318dd1039dc5a7 to your computer and use it in GitHub Desktop.
Save sieste/d1b3b50fb735204e0a318dd1039dc5a7 to your computer and use it in GitHub Desktop.
MTH3028 Lecture 1.7
n = 1
theta = 1
alpha = 0.05
lo = up = numeric(10000)
for (i in 1:10000) {
x = rexp(n, 1/theta)
lo[i] = -x / log(alpha)
up[i] = -x / log(1-alpha)
}
mean(theta < lo)
mean(theta > up)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment