The book's workers¶
The Chapter 4 example workers. A worker has the signature worker(rg, n, n_reps, param_tuple).
simstreams.workers ¶
The book's example workers (Chapter 4).
A worker has the signature worker(rg, n, n_reps, param_tuple). It draws
from rg, the process's own generator, generates data for n_reps
replications of size n, computes the quantity of interest for each
replication, and returns the results.
pi_worker ¶
pi_worker(rg, n, n_reps, param_tuple)
Estimate pi by dart throwing.
Each replication throws n uniform points at the square [-1, 1]^2 and
estimates pi as four times the fraction that land inside the unit circle.
param_tuple is unused.
Returns an array of n_reps estimates.
Source code in src/simstreams/workers.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | |
cauchy_worker ¶
cauchy_worker(rg, n, n_reps, param_tuple)
Estimate the Cauchy scale by half the interquartile range.
Each replication draws n observations from a Cauchy distribution with
scale theta = param_tuple[0] by the quantile transformation and
estimates the scale as half the sample interquartile range.
Returns an array of n_reps scale estimates.
Source code in src/simstreams/workers.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | |