Draws¶
- class telescopic.kernels.Draws(streams, lanes)¶
Random numbers for a set of chains: row
iof every request belongs to chaini.Kernels receive a
Drawsand call it once per random quantity they need per step; every request returns one row per chain. In a run, each row reads the streams of its replicate. Draws are made by the engine, or bytelescopic.testing.fixed_draws()andtelescopic.testing.random_draws()in tests.- child(row)¶
A new child of the generator of a row’s stream, which does not move that stream.
Each call spawns the next child. In a run, the children of a replicate’s generator follow the two that serve its normals and uniforms, so they never repeat them.
- Parameters:
- row
int The row, in
[0, n).
- row
- Returns:
numpy.random.Generatordraws.generator(row).spawn(1)[0]; NumPy raisesTypeErrorfor a generator built without a seed sequence, which cannot spawn.
- generator(row)¶
The generator of a row’s stream, for draws that the buffers do not cover.
- Parameters:
- row
int The row, in
[0, n).
- row
- Returns:
- log_uniform()¶
Logarithms of uniform draws on [0, 1), one per row;
-inffor a draw of 0.- Returns:
ndarray, shape (n,)
- normal(size)¶
Standard normal draws,
sizeper row.
- subset(rows)¶
The draws of some rows of this set; they share the rows’ streams.
- Parameters:
- rowsarray_like of
int The rows, in
[0, n); rowiof the result is rowrows[i]of this set.
- rowsarray_like of
- Returns: