Created
November 10, 2016 23:09
-
-
Save NoRaincheck/ae8164de20935349629e9f049d0d4cf1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mu <- 2.5 | |
tau <- 0.5 | |
xn <- rnorm(50, mu, 1/tau) | |
# test for convergence | |
library(purrr) | |
mu_i = 0 | |
alpha = 0.01 | |
for(i in 1:10000000){ | |
mu_i <- mu_i - alpha * (tau *(mu_i - mean(xn))) | |
print(mu_i) | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment