Skip to content

Instantly share code, notes, and snippets.

@hrstt
Created November 11, 2016 00:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hrstt/2e374664259d0a6e1e0a03f1a4c2ad7a to your computer and use it in GitHub Desktop.
Save hrstt/2e374664259d0a6e1e0a03f1a4c2ad7a to your computer and use it in GitHub Desktop.
一様分布の和の平均は正規分布の近似に使える(中心極限定理)
sum_runif <- function(x) {
a <- runif(n = 1000)
if (x <= 1) return(a)
else return(a + Recall(x-1))
}
hist(sum_runif(5))
hist(sum_runif(1))
hist(sum_runif(10))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment