pymc.distributions.shape_utils.change_dist_size#

pymc.distributions.shape_utils.change_dist_size(dist, new_size, expand=False)[source]#

Change or expand the size of a Distribution.

Parameters
dist:

The old distribution to be resized.

new_size:

The new size of the distribution.

expand: bool, optional

If True, new_size is prepended to the existing distribution size, so that the final size is equal to (*new_size, *dist.size). Defaults to false.

Returns
A new distribution variable that is equivalent to the original distribution with
the new size. The new distribution will not reuse the old RandomState/Generator
input, so it will be independent from the original distribution.

Examples