DiscreteTimeStateTransitionModel.sample

DiscreteTimeStateTransitionModel.sample#

DiscreteTimeStateTransitionModel.sample(sample_shape=(), seed=None, name='sample', **kwargs)#

Generate samples of the specified shape.

Note that a call to sample() without arguments will generate a single sample.

Additional documentation from DiscreteTimeStateTransitionModel:

Runs n simulations of the epidemic model.

Parameters:
  • n – number of simulations to run.

  • seed – an integer or a JAX PRNG key.

  • sample_shape – 0D or 1D int32 Tensor. Shape of the generated samples.

  • seed – PRNG seed; see tfp.random.sanitize_seed for details.

  • name – name to give to the op.

  • **kwargs – Named arguments forwarded to subclass implementation.

Returns:

an array of shape (n, T, N, R) for n samples, T=self.num_steps time steps, N=self.num_units units and R=self.transition_matrix.shape[0] transitions, containing the number of events for each timestep, unit and transition.

Returns:

a Tensor with prepended dimensions sample_shape.

Return type:

samples