great explaination. Here is the code explained in the lecture: nSimulations = 100000 nSample = 100 Y = numeric(nSimulations) for(i in 1:nSimulations){ X = runif(n); Y[i] = mean(X) } sigma = sd(Y) mu = mean(Y) hist((Y-mu)/sigma, breaks = 50) Here, I have scaled and shifted the random variable to make it the standard normal. Also, you can replace runif() with any other distribution of your choice.
great explaination. Here is the code explained in the lecture:
nSimulations = 100000
nSample = 100
Y = numeric(nSimulations)
for(i in 1:nSimulations){
X = runif(n);
Y[i] = mean(X)
}
sigma = sd(Y)
mu = mean(Y)
hist((Y-mu)/sigma, breaks = 50)
Here, I have scaled and shifted the random variable to make it the standard normal. Also, you can replace runif() with any other distribution of your choice.
hello, how do you move around the lines? I was keep pressing shift+enter to go below the line without producing something..
cntrl+enter or cmd+enter
Merci beau gosse