Skip to content

Commit 2d23601

Browse files
committed
touchups
1 parent 6cfccfa commit 2d23601

File tree

4 files changed

+23
-7
lines changed

4 files changed

+23
-7
lines changed

vignettes/Catch_errors.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ runSimulation(Design, replications = 100, load_seed=picked_seed, debug='analyse-
148148

149149
The `.Random.seed` state will be loaded at this exact state, and will always be repeated at this state as well (in case `c` is typed in the debugger, or somehow the error is harder to find while walking through the debug mode). Hence, users must type `Q` to exit the debugger after they have better understood the nature of the error message first-hand, after which the `load_seed` input should be removed.
150150

151-
# Converting warings to errors explicitly via `manageWarnings()`
151+
# Converting warnings to errors explicitly via `manageWarnings()`
152152

153153
```{r include=FALSE}
154154
knitr::opts_chunk$set(

vignettes/Fixed_obj_fun.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,4 +157,4 @@ res <- runSimulation(Design, replications, verbose=FALSE, fixed_objects=fixed_ob
157157
parallel = TRUE)
158158
```
159159

160-
Again, remember that this is only required for R **objects**, NOT for user-defined or third-party functions!
160+
Again, remember that this is only required for **R objects that are NOT user-defined functions or third-party functions**!

vignettes/HPC-computing.Rmd

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ output:
1313
smooth_scroll: false
1414
vignette: >
1515
%\VignetteIndexEntry{HPC cluster array jobs (e.g., via Slurm)}
16-
%\VignetteEngine{knitr::rmarkdown}
1716
%\VignetteEncoding{UTF-8}
17+
%\VignetteEngine{knitr::rmarkdown}
18+
editor_options:
19+
chunk_output_type: console
1820
---
1921

2022
```{r nomessages, echo = FALSE}
@@ -121,6 +123,7 @@ While generally effective at distributing the computational load, there are a fe
121123
5) Submitting independent multiple batches to the cluster makes it more difficult to guarantee the quality of the random numbers
122124
- Setting the `seed` for each condition ensure that within each `design` condition the random numbers are high quality, however there is no guarantee that repeated use of `set.seed()` will result in high-quality random numbers (see next section for example)
123125
- Hence, repeated job submissions of this type, even with unique seeds per condition, may not generate high quality numbers if repeated too many times (alternative is to isolate each `design` row and submit each row as a unique job, which is demonstrated near the end of this vignette)
126+
- Note that there are workarounds with more recent `runSimulation()` implementations when combined with `expandDesign()` (see below), however given the nature of the complete job submission these remain less ideal
124127
6) Finally, and perhaps most problematic in simulation experiment applications, schedulers frequently cap the maximum number of resources that can be requested (e.g., 256 GB of RAM, 200 CPUs), which limits the application of large RAM and CPU jobs
125128
- Note that to avoid wasting time by swapping/paging, schedulers will never allocate jobs whose memory requirements exceed the amount of available memory
126129

@@ -166,7 +169,8 @@ print(Design300, show.IDs = TRUE)
166169
rep_target <- 10000
167170
168171
# replications per row in Design300
169-
replications <- rep(rep_target / rc, nrow(Design300))
172+
replications <- expandReplications(rep_target, repeat_conditions = rc)
173+
replications
170174
```
171175
The above approach assumes that each `design` condition is equally balanced in terms of computing time and resources, though if this is not the case (e.g., the last condition contains notably higher computing times than the first two conditions) then `repeat_conditions` can be specified as a vector instead, such as `repeat_conditions = c(100, 100, 1000)`, which for the latter portion would be associated with a 10 replications per distributed node instead of 100.
172176

@@ -176,8 +180,9 @@ DesignUnbalanced <- expandDesign(Design, repeat_conditions = rc)
176180
DesignUnbalanced
177181
178182
rep_target <- 10000
179-
replicationsUnbalanced <- rep(rep_target / rc, times = rc)
183+
replicationsUnbalanced <- expandReplications(rep_target, rc)
180184
head(replicationsUnbalanced)
185+
tail(replicationsUnbalanced)
181186
table(replicationsUnbalanced)
182187
```
183188

@@ -298,7 +303,7 @@ rc <- 100
298303
Design300 <- expandDesign(Design, repeat_conditions = rc)
299304
300305
rep_target <- 10000
301-
replications <- rep(rep_target / rc, nrow(Design300))
306+
replications <- expandReplications(rep_target, repeat_conditions = rc)
302307
303308
# genSeeds() # do this once on the main node/home computer, and store the number!
304309
iseed <- 1276149341

vignettes/SimDesign-intro.Rmd

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,18 @@ As can be seen from the printed results from the `res` object, each result from
214214
respective condition, meta-statistics have been properly named, and three additional columns have been appended
215215
to the results: `REPLICATIONS`, which indicates how many time the conditions were performed, `SIM_TIME`, indicating
216216
the time (in seconds) it took to completely finish the respective conditions, and `SEED`, which indicates the random seeds used by `SimDesign` for each condition (for reproducibility). A call to `View()` in the
217-
R console may also be a nice way to sift through the `res` object.
217+
R console may also be a nice way to sift through the `res` object, while for the
218+
`results` object one can use functions like `descript()` and verbs from the `dplyr` package to get a better understanding of the distributions.
219+
220+
```{r}
221+
# summary statistics for complete results
222+
descript(results)
223+
224+
# conditional summary statistics using dplyr verbs
225+
results |> dplyr::group_by(sample_size, distribution) |>
226+
descript()
227+
```
228+
218229

219230
## Interpreting the results
220231

0 commit comments

Comments
 (0)