Skip to contents

The serial counterpart of sim_template(): the same seed and stream layout as a one-process run, executed in the current R session with no cluster. Useful for debugging a worker before running it in parallel, and for the one-core baseline of a timing experiment. The result equals sim_template(worker, seed, n, n_reps, 1, ...)[[1]].

Usage

sim_template_serial(worker, seed, n, n_reps, ...)

Arguments

worker

A worker function worker(n, set_up, ...).

seed

Master seed.

n

Sample size for each replication.

n_reps

Total number of replications.

...

Model parameters passed on to worker.

Value

The worker's result for all n_reps replications.

Examples

theta_hat <- sim_template_serial(iqr_worker, 1234, 100, 20, 5)
round(theta_hat, 3)
#>  [1] 4.604 4.698 5.314 4.536 5.184 6.082 5.263 4.954 5.373 4.054 3.944 4.226
#> [13] 4.399 4.352 3.283 3.484 3.562 5.182 5.597 5.387