Number of repetitions nrep

Sampling theory applies to the number of repetitions nrep (also referred to as the number of replications) just as much as it does to the sample size n within a simulation.

Means and SDs from 24 repetitions simulating N(0,1) with n = 10:



Now, let’s do the same with a number of repetitions nrep of 1000.

Means and SDs from 1000 repetitions simulating N(0,1) with n = 10:



Conclusion

The number of repetitions needs to be a large enough number to obtain a good representation of the distribution of the simulation results, e.g. 1000.


YOUR TURN:
The code generating the data and plots presented above are included in your exercise script. Feel free to modify the parameters of the functions that simulate data and plot the results to better understand the principles presented in these two pages, but, at this stage, there is no need to fully understand the code that generates the plots.


Back to top