-
Notifications
You must be signed in to change notification settings - Fork 76
/
number-of-simulations-nrep.qmd
28 lines (17 loc) · 1.08 KB
/
number-of-simulations-nrep.qmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# 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:**
<br/>
<img src="../assets/musd-24-10-N01.png" width="500">
<br/>
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:**
<br/>
<img src="../assets/1000hist10N01.png" width="500">
<br/>
### 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.
***