Created
April 23, 2018 23:20
dist of mean of dist
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
R=10000; N=1000 | |
xm = numeric(R) | |
for (i in 1:R) { | |
#好きなように | |
xm[i] = mean(rlnorm(N)) | |
# xm[i] = mean(rexp(N)) | |
# xm[i] = mean(runif(N)) | |
} | |
hist(xm, breaks = 100, probability = TRUE) | |
library(MASS) | |
fit = fitdistr(xm, densfun = "normal") | |
curve(dnorm(x, fit$estimate[1], fit$estimate[2]), add = TRUE, col = "red") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment