Create a random variable for Autoregressive.

See Autoregressive for more details.



Original Docstring for Distribution

Construct an Autoregressive distribution.


  • distribution_fn: Python callable which constructs a tfd.Distribution-like instance from a Tensor (e.g., sample0). The function must respect the "autoregressive property", i.e., there exists a permutation of event such that each coordinate is a diffeomorphic function of on preceding coordinates.
  • sample0: Initial input to distribution_fn; used to build the distribution in __init__ which in turn specifies this distribution's properties, e.g., event_shape, batch_shape, dtype. If unspecified, then distribution_fn should be default constructable.
  • num_steps: Number of times distribution_fn is composed from samples, e.g., num_steps=2 implies distribution_fn(distribution_fn(sample0).sample(n)).sample().
  • validate_args: Python bool. Whether to validate input with asserts. If validate_args is False, and the inputs are invalid, correct behavior is not guaranteed.
  • allow_nan_stats: Python bool, default True. When True, statistics (e.g., mean, mode, variance) use the value "NaN" to indicate the result is undefined. When False, an exception is raised if one or more of the statistic's batch members are undefined.
  • name: Python str name prefixed to Ops created by this class. Default value: "Autoregressive".


  • ValueError: if num_steps and distribution_fn(sample0).event_shape.num_elements() are both None.
  • ValueError: if num_steps < 1.