basic – Low-level random numbers¶

The aesara.tensor.random module provides random-number drawing functionality that closely resembles the numpy.random module.

Reference¶

class aesara.tensor.random.RandomStream[source]

A helper class that tracks changes in a shared numpy.random.RandomState and behaves like numpy.random.RandomState by managing access to RandomVariables. For example:

from aesara.tensor.random.utils import RandomStream

rng = RandomStream()
sample = rng.normal(0, 1, size=(2, 2))

class aesara.tensor.random.RandomStateType(Type)[source]

A Type for variables that will take numpy.random.RandomState values.

aesara.tensor.random.random_state_type(name=None)[source]

Return a new Variable whose Variable.type is an instance of RandomStateType.

class aesara.tensor.random.RandomVariable(Op)[source]

Op that draws random numbers from a numpy.random.RandomState object. This Op is parameterized to draw numbers from many possible distributions.

Distributions¶

Aesara can produce RandomVariables that draw samples from many different statistical distributions, using the following Ops. The RandomVariables behave similarly to NumPy’s Generalized Universal Functions (or gunfunc): it supports “core” random variable Ops that map distinctly shaped inputs to potentially non-scalar outputs. We document this behavior in the following with gufunc-like signatures.

class aesara.tensor.random.basic.UniformRV(name=None, ndim_supp=None, ndims_params=None, dtype=None, inplace=None)[source]

A uniform continuous random variable.

The probability density function for uniform within the interval is:

__call__(low=0.0, high=1.0, size=None, **kwargs)[source]

Draw samples from a uniform distribution.

The results are undefined when high < low.

Signature¶

(), () -> ()

param low: Lower boundary of the output interval; all values generated will be greater than or equal to low. Upper boundary of the output interval; all values generated will be less than or equal to high. Sample shape. If the given size is, e.g. (m, n, k) then m * n * k independent, identically distributed random variables are returned. Default is None in which case a single random variable is returned.
class aesara.tensor.random.basic.RandIntRV(name=None, ndim_supp=None, ndims_params=None, dtype=None, inplace=None)[source]

A discrete uniform random variable.

Only available for RandomStateType. Use integers with RandomGeneratorTypes.

__call__(low, high=None, size=None, **kwargs)[source]

Draw samples from a discrete uniform distribution.

Signature¶

() -> ()

param low: Lower boundary of the output interval. All values generated will be greater than or equal to low, unless high=None, in which case all values generated are greater than or equal to 0 and smaller than low (exclusive). Upper boundary of the output interval. All values generated will be smaller than high (exclusive). Sample shape. If the given size is (m, n, k), then m * n * k independent, identically distributed samples are returned. Default is None, in which case a single sample is returned.
class aesara.tensor.random.basic.IntegersRV(name=None, ndim_supp=None, ndims_params=None, dtype=None, inplace=None)[source]

A discrete uniform random variable.

Only available for RandomGeneratorType. Use randint with RandomStateTypes.

__call__(low, high=None, size=None, **kwargs)[source]

Draw samples from a discrete uniform distribution.

Signature¶

() -> ()

param low: Lower boundary of the output interval. All values generated will be greater than or equal to low (inclusive). Upper boundary of the output interval. All values generated will be smaller than high (exclusive). Sample shape. If the given size is (m, n, k), then m * n * k independent, identically distributed samples are returned. Default is None, in which case a single sample is returned.
class aesara.tensor.random.basic.ChoiceRV(name=None, ndim_supp=None, ndims_params=None, dtype=None, inplace=None)[source]

Randomly choose an element in a sequence.

__call__(a, size=None, replace=True, p=None, **kwargs)[source]

Generate a random sample from an array.

Signature¶

(x) -> ()

param a: The array from which to randomly sample an element. If an int, a sample is generated from aesara.tensor.arange(a). Sample shape. If the given size is (m, n, k), then m * n * k independent samples are returned. Default is None, in which case a single sample is returned. When True, sampling is performed with replacement. The probabilities associated with each entry in a. If not given, all elements have equal probability.
class aesara.tensor.random.basic.PermutationRV(name=None, ndim_supp=None, ndims_params=None, dtype=None, inplace=None)[source]

Randomly shuffle a sequence.

__call__(x, **kwargs)[source]

Randomly permute a sequence or a range of values.

Signature¶

(x) -> (x)

param x: If x is an integer, randomly permute np.arange(x). If x is a sequence, shuffle its elements randomly.
class aesara.tensor.random.basic.BernoulliRV(name=None, ndim_supp=None, ndims_params=None, dtype=None, inplace=None)[source]

A Bernoulli discrete random variable.

The probability mass function for bernoulli in terms of the probability of success of a single trial is:

where .

__call__(p, size=None, **kwargs)[source]

Draw samples from a Bernoulli distribution.

Signature¶

() -> ()

param p: Probability of success of a single trial. Sample shape. If the given size is (m, n, k), then m * n * k independent, identically distributed samples are returned. Default is None in which case a single sample is returned.
class aesara.tensor.random.basic.BetaRV(name=None, ndim_supp=None, ndims_params=None, dtype=None, inplace=None)[source]

A beta continuous random variable.

The probability density function for beta in terms of its parameters and is:

for . is the beta function defined as:

__call__(alpha, beta, size=None, **kwargs)[source]

Draw samples from a beta distribution.

Signature¶

(), () -> ()

param alpha: Alpha parameter of the distribution. Must be positive. Beta parameter of the distribution. Must be positive. Sample shape. If the given size is, e.g. (m, n, k) then m * n * k independent, identically distributed random variables are returned. Default is None in which case a single random variable is returned.
class aesara.tensor.random.basic.BetaBinomialRV(name=None, ndim_supp=None, ndims_params=None, dtype=None, inplace=None)[source]

A beta-binomial discrete random variable.

The probability mass function for betabinom in terms of its shape parameters , , and the probability is:

where is the beta function:

__call__(n, a, b, size=None, **kwargs)[source]

Draw samples from a beta-binomial distribution.

Signature¶

(), (), () -> ()

param n: Shape parameter . Must be a positive integer. Shape parameter . Must be positive. Shape parameter . Must be positive. Sample shape. If the given size is (m, n, k), then m * n * k independent, identically distributed samples are returned. Default is None in which case a single sample is returned.
class aesara.tensor.random.basic.BinomialRV(name=None, ndim_supp=None, ndims_params=None, dtype=None, inplace=None)[source]

A binomial discrete random variable.

The probability mass function for binomial for the number of successes in terms of the probability of success of a single trial and the number of trials is:

__call__(n, p, size=None, **kwargs)[source]

Draw samples from a binomial distribution.

Signature¶

(), () -> ()

param n: Number of trials . Must be a positive integer. Probability of success of a single trial. Sample shape. If the given size is (m, n, k), then m * n * k independent, identically distributed samples are returned. Default is None in which case a single sample is returned.
class aesara.tensor.random.basic.CauchyRV(name=None, ndim_supp=None, ndims_params=None, dtype=None, inplace=None)[source]

A Cauchy continuous random variable.

The probability density function for cauchy in terms of its location parameter and scale parameter is:

where .

__call__(loc=0.0, scale=1.0, size=None, **kwargs)[source]

Draw samples from a Cauchy distribution.

Signature¶

(), () -> ()

param loc: Location parameter of the distribution. Scale parameter of the distribution. Must be positive. Sample shape. If the given size is (m, n, k), then m * n * k independent, identically distributed samples are returned. Default is None in which case a single sample is returned.
class aesara.tensor.random.basic.CategoricalRV(name=None, ndim_supp=None, ndims_params=None, dtype=None, inplace=None)[source]

A categorical discrete random variable.

The probability mass function of categorical in terms of its event probabilities is:

where .

__call__(p, size=None, **kwargs)[source]

Draw samples from a discrete categorical distribution.

Signature¶

(j) -> ()

param p: An array that contains the event probabilities. Sample shape. If the given size is (m, n, k), then m * n * k independent, identically distributed random samples are returned. Default is None, in which case a single sample is returned.
class aesara.tensor.random.basic.ChiSquareRV(name=None, ndim_supp=None, ndims_params=None, dtype=None, inplace=None)[source]

A chi square continuous random variable.

The probability density function for chisquare in terms of the number of degrees of freedom is:

for . is the gamma function:

This variable is obtained by summing the squares independent, standard normally distributed random variables.

__call__(df, size=None, **kwargs)[source]

Draw samples from a chisquare distribution.

Signature¶

() -> ()

param df: The number of degrees of freedom. Must be positive. Sample shape. If the given size is, e.g. (m, n, k) then m * n * k independent, identically distributed random variables are returned. Default is None in which case a single random variable is returned.
class aesara.tensor.random.basic.DirichletRV(name=None, ndim_supp=None, ndims_params=None, dtype=None, inplace=None)[source]

A Dirichlet continuous random variable.

The probability density function for dirichlet in terms of the vector of concentration parameters is:

where is a vector, such that and .

__call__(alphas, size=None, **kwargs)[source]

Draw samples from a dirichlet distribution.

Signature¶

(k) -> (k)

param alphas: A sequence of concentration parameters of the distribution. A sequence of length k will produce samples of length k. Given a size of, for example, (r, s, t), r * s * t independent, identically distributed samples are generated. Because each sample is k-dimensional, the output shape is (r, s, t, k). If no shape is specified, a single k-dimensional sample is returned.
class aesara.tensor.random.basic.ExponentialRV(name=None, ndim_supp=None, ndims_params=None, dtype=None, inplace=None)[source]

An exponential continuous random variable.

The probability density function for exponential in terms of its scale parameter is:

for and .

__call__(scale=1.0, size=None, **kwargs)[source]

Draw samples from an exponential distribution.

Signature¶

() -> ()

param scale: The scale of the distribution. Must be positive. Sample shape. If the given size is, e.g. (m, n, k) then m * n * k independent, identically distributed random variables are returned. Default is None in which case a single random variable is returned.
class aesara.tensor.random.basic.GammaRV(name=None, ndim_supp=None, ndims_params=None, dtype=None, inplace=None)[source]

A gamma continuous random variable.

The probability density function for gamma in terms of the shape parameter and rate parameter is:

for , and . is the gamma function:

__call__(shape, rate, size=None, **kwargs)[source]

Draw samples from a gamma distribution.

Signature¶

(), () -> ()

param shape: The shape of the gamma distribution. Must be positive. The rate of the gamma distribution. Must be positive. Sample shape. If the given size is, e.g. (m, n, k) then m * n * k independent, identically distributed random variables are returned. Default is None in which case a single random variable is returned.
class aesara.tensor.random.basic.GenGammaRV(name=None, ndim_supp=None, ndims_params=None, dtype=None, inplace=None)[source]

A generalized gamma continuous random variable.

The probability density function of gengamma in terms of its scale parameter and other parameters and is:

for , where .

__call__(alpha=1.0, p=1.0, lambd=1.0, size=None, **kwargs)[source]

Draw samples from a generalized gamma distribution.

Signature¶

(), (), () -> ()

param alpha: Parameter . Must be positive. Parameter . Must be positive. Scale parameter . Must be positive. Sample shape. If the given size is (m, n, k), then m * n * k independent, identically distributed samples are returned. Default is None in which case a single sample is returned.
class aesara.tensor.random.basic.GeometricRV(name=None, ndim_supp=None, ndims_params=None, dtype=None, inplace=None)[source]

A geometric discrete random variable.

The probability mass function for geometric for the number of successes before the first failure in terms of the probability of success of a single trial is:

for .

__call__(p, size=None, **kwargs)[source]

Draw samples from a geometric distribution.

Signature¶

() -> ()

param p: Probability of success of an individual trial. Sample shape. If the given size is, e.g. (m, n, k) then m * n * k independent, identically distributed samples are returned. Default is None in which case a single sample is returned.
class aesara.tensor.random.basic.GumbelRV(name=None, ndim_supp=None, ndims_params=None, dtype=None, inplace=None)[source]

A gumbel continuous random variable.

The probability density function for gumbel in terms of its location parameter and scale parameter is:

for .

__call__(loc: Union[ndarray, float], scale: Union[ndarray, float] = 1.0, size: Optional[Union[List[int], int]] = None, **kwargs) RandomVariable[source]

Draw samples from a gumbel distribution.

Signature¶

(), () -> ()

param loc: The location parameter of the distribution. The scale of the distribution. Must be positive. Sample shape. If the given size is, e.g. (m, n, k) then m * n * k independent, identically distributed random variables are returned. Default is None in which case a single random variable is returned.
class aesara.tensor.random.basic.HalfCauchyRV(name=None, ndim_supp=None, ndims_params=None, dtype=None, inplace=None)[source]

A half-Cauchy continuous random variable.

The probability density function for halfcauchy in terms of its location parameter and scale parameter is:

for where .

__call__(loc=0.0, scale=1.0, size=None, **kwargs)[source]

Draw samples from a half-Cauchy distribution.

Signature¶

(), () -> ()

param loc: Location parameter of the distribution. Scale parameter of the distribution. Must be positive. Sample shape. If the given size is (m, n, k), then m * n * k independent, identically distributed samples are returned. Default is None, in which case a single sample is returned.
class aesara.tensor.random.basic.HalfNormalRV(name=None, ndim_supp=None, ndims_params=None, dtype=None, inplace=None)[source]

A half-normal continuous random variable.

The probability density function for halfnormal in terms of its location parameter and scale parameter is:

for and .

__call__(loc=0.0, scale=1.0, size=None, **kwargs)[source]

Draw samples from a half-normal distribution.

Signature¶

(), () -> ()

param loc: Location parameter of the distribution. Scale parameter of the distribution. Sample shape. If the given size is, e.g. (m, n, k) then m * n * k independent, identically distributed random variables are returned. Default is None in which case a single random variable is returned.
class aesara.tensor.random.basic.HyperGeometricRV(name=None, ndim_supp=None, ndims_params=None, dtype=None, inplace=None)[source]

A hypergeometric discrete random variable.

The probability mass function for hypergeometric for the number of successes in draws without replacement, from a finite population of size with desired items is:

__call__(ngood, nbad, nsample, size=None, **kwargs)[source]

Draw samples from a geometric distribution.

Signature¶

(), (), () -> ()

param ngood: Number of desirable items in the population. Positive integer. Number of undesirable items in the population. Positive integer. Number of items sampled. Must be less than , i.e. ngood + nbad. Positive integer. Sample shape. If the given size is, e.g. (m, n, k) then m * n * k independent, identically distributed samples are returned. Default is None in which case a single sample is returned.
class aesara.tensor.random.basic.InvGammaRV(name=None, ndim_supp=None, ndims_params=None, dtype=None, inplace=None)[source]

An inverse-gamma continuous random variable.

The probability density function for invgamma in terms of its shape parameter and scale parameter is:

for , where and . is the gamma function :

__call__(shape, scale, size=None, **kwargs)[source]

Draw samples from an inverse-gamma distribution.

Signature¶

(), () -> ()

param shape: Shape parameter of the distribution. Must be positive. Scale parameter of the distribution. Must be positive. Sample shape. If the given size is (m, n, k), then m * n * k independent, identically distributed sample are returned. Default is None, in which case a single sample is returned.
class aesara.tensor.random.basic.LaplaceRV(name=None, ndim_supp=None, ndims_params=None, dtype=None, inplace=None)[source]

A Laplace continuous random variable.

The probability density function for laplace in terms of its location parameter and scale parameter is:

with .

__call__(loc=0.0, scale=1.0, size=None, **kwargs)[source]

Draw samples from a Laplace distribution.

Signature¶

(), () -> ()

param loc: Location parameter of the distribution. Scale parameter of the distribution. Must be positive. Sample shape. If the given size is (m, n, k), then m * n * k independent, identically distributed samples are returned. Default is None in which case a single sample is returned.
class aesara.tensor.random.basic.LogisticRV(name=None, ndim_supp=None, ndims_params=None, dtype=None, inplace=None)[source]

A logistic continuous random variable.

The probability density function for logistic in terms of its location parameter and scale parameter is :

for .

__call__(loc=0, scale=1, size=None, **kwargs)[source]

Draw samples from a logistic distribution.

Signature¶

(), () -> ()

param loc: The location parameter of the distribution. The scale of the distribution. Must be positive. Sample shape. If the given size is, e.g. (m, n, k) then m * n * k independent, identically distributed random variables are returned. Default is None in which case a single random variable is returned.
class aesara.tensor.random.basic.LogNormalRV(name=None, ndim_supp=None, ndims_params=None, dtype=None, inplace=None)[source]

A lognormal continuous random variable.

The probability density function for lognormal in terms of the mean parameter and sigma parameter is:

for and .

__call__(mean=0.0, sigma=1.0, size=None, **kwargs)[source]

Draw sample from a lognormal distribution.

Signature¶

(), () -> ()

param mean: Mean of the random variable’s natural logarithm. Standard deviation of the random variable’s natural logarithm. Sample shape. If the given size is, e.g. (m, n, k) then m * n * k independent, identically distributed random variables are returned. Default is None in which case a single random variable is returned.
class aesara.tensor.random.basic.MultinomialRV(name=None, ndim_supp=None, ndims_params=None, dtype=None, inplace=None)[source]

A multinomial discrete random variable.

The probability mass function of multinomial in terms of the number of experiments and the probabilities of the different possible outcomes is:

where and .

Notes

The length of the support dimension is determined by the last dimension in the second parameter (i.e. the probabilities vector).

__call__(n, p, size=None, **kwargs)[source]

Draw samples from a discrete multinomial distribution.

Signature¶

(), (n) -> (n)

param n: Number of experiments . Must be a positive integer. Probabilities of each of the different outcomes. Given a size of, for example, (r, s, t), r * s * t independent, identically distributed samples are generated. Because each sample is k-dimensional, the output shape is (r, s, t, k). If no shape is specified, a single k-dimensional sample is returned.
class aesara.tensor.random.basic.MvNormalRV(name=None, ndim_supp=None, ndims_params=None, dtype=None, inplace=None)[source]

A multivariate normal random variable.

The probability density function for multivariate_normal in term of its location parameter and covariance matrix is

where is a positive semi-definite matrix.

__call__(mean=None, cov=None, size=None, **kwargs)[source]

“Draw samples from a multivariate normal distribution.

Signature¶

(n), (n,n) -> (n)

param mean: Location parameter (mean) of the distribution. Vector of length N. Covariance matrix of the distribution. Must be a symmetric and positive-semidefinite NxN matrix. Given a size of, for example, (m, n, k), m * n * k independent, identically distributed samples are generated. Because each sample is N-dimensional, the output shape is (m, n, k, N). If no shape is specified, a single N-dimensional sample is returned.
class aesara.tensor.random.basic.NegBinomialRV(name=None, ndim_supp=None, ndims_params=None, dtype=None, inplace=None)[source]

A negative binomial discrete random variable.

The probability mass function for nbinom for the number of draws before observing the th success in terms of the probability of success of a single trial is:

__call__(n, p, size=None, **kwargs)[source]

Draw samples from a negative binomial distribution.

Signature¶

(), () -> ()

param n: Number of successes . Must be a positive integer. Probability of success of a single trial. Sample shape. If the given size is (m, n, k), then m * n * k independent, identically distributed samples are returned. Default is None in which case a single sample is returned.
class aesara.tensor.random.basic.NormalRV(name=None, ndim_supp=None, ndims_params=None, dtype=None, inplace=None)[source]

A normal continuous random variable.

The probability density function for normal in terms of its location parameter (mean) and scale parameter (standard deviation) is:

for .

__call__(loc=0.0, scale=1.0, size=None, **kwargs)[source]

Draw samples from a normal distribution.

Signature¶

(), () -> ()

param loc: Mean of the normal distribution. Standard deviation of the normal distribution. Must be positive. Sample shape. If the given size is, e.g. (m, n, k) then m * n * k independent, identically distributed random variables are returned. Default is None in which case a single random variable is returned.
class aesara.tensor.random.basic.ParetoRV(name=None, ndim_supp=None, ndims_params=None, dtype=None, inplace=None)[source]

A pareto continuous random variable.

The probability density function for pareto in terms of its shape parameter and scale parameter is:

and is defined for .

__call__(b, scale=1.0, size=None, **kwargs)[source]

Draw samples from a pareto distribution.

Signature¶

(), () -> ()

param b: The shape (or exponent) of the pareto distribution. Must be positive. The scale of the pareto distribution. Must be positive. Sample shape. If the given size is, e.g. (m, n, k) then m * n * k independent, identically distributed random variables are returned. Default is None in which case a single random variable is returned.
class aesara.tensor.random.basic.PoissonRV(name=None, ndim_supp=None, ndims_params=None, dtype=None, inplace=None)[source]

A poisson discrete random variable.

The probability mass function for poisson in terms of the expected number of events is:

for .

__call__(lam=1.0, size=None, **kwargs)[source]

Draw samples from a poisson distribution.

Signature¶

() -> ()

param lam: Expected number of events . Must be positive. Sample shape. If the given size is, e.g. (m, n, k) then m * n * k independent, identically distributed random variables are returned. Default is None in which case a single random variable is returned.
class aesara.tensor.random.basic.StandardNormalRV(name=None, ndim_supp=None, ndims_params=None, dtype=None, inplace=None)[source]

A standard normal continuous random variable.

The probability density function for standard_normal is:

__call__(size=None, **kwargs)[source]

Draw samples from a standard normal distribution.

Signature¶

nil -> ()

param size: Sample shape. If the given size is, e.g. (m, n, k) then m * n * k independent, identically distributed random variables are returned. Default is None in which case a single random variable is returned.
class aesara.tensor.random.basic.StudentTRV(name=None, ndim_supp=None, ndims_params=None, dtype=None, inplace=None)[source]

A Student’s t continuous random variable.

The probability density function for t in terms of its degrees of freedom parameter , location parameter and scale parameter is:

for , .

__call__(df, loc=0.0, scale=1.0, size=None, **kwargs)[source]

Draw samples from a Student’s t distribution.

Signature¶

(), (), () -> ()

param df: Degrees of freedom parameter of the distribution. Must be positive. Location parameter of the distribution. Scale parameter of the distribution. Must be positive. Sample shape. If the given size is (m, n, k), then m * n * k independent, identically distributed samples are returned. Default is None in which case a single sample is returned.
class aesara.tensor.random.basic.TriangularRV(name=None, ndim_supp=None, ndims_params=None, dtype=None, inplace=None)[source]

A triangular continuous random variable.

The probability density function for triangular within the interval and mode (where the peak of the distribution occurs) is:

__call__(left, mode, right, size=None, **kwargs)[source]

Draw samples from a triangular distribution.

Signature¶

(), (), () -> ()

param left: Lower boundary of the output interval; all values generated will be greater than or equal to left. Mode of the distribution, where the peak occurs. Must be such that left <= mode <= right. Upper boundary of the output interval; all values generated will be less than or equal to right. Must be larger than left. Sample shape. If the given size is, e.g. (m, n, k) then m * n * k independent, identically distributed random variables are returned. Default is None in which case a single random variable is returned.
class aesara.tensor.random.basic.TruncExponentialRV(name=None, ndim_supp=None, ndims_params=None, dtype=None, inplace=None)[source]

A truncated exponential continuous random variable.

The probability density function for truncexp in terms of its shape parameter , location parameter and scale parameter is:

for and .

__call__(b, loc=0.0, scale=1.0, size=None, **kwargs)[source]

Draw samples from a truncated exponential distribution.

Signature¶

(), (), () -> ()

param b: Shape parameter of the distribution. Must be positive. Location parameter of the distribution. Scale parameter of the distribution. Must be positive. Sample shape. If the given size is (m, n, k), then m * n * k independent, identically distributed samples are returned. Default is None in which case a single sample is returned.
class aesara.tensor.random.basic.VonMisesRV(name=None, ndim_supp=None, ndims_params=None, dtype=None, inplace=None)[source]

A von Misses continuous random variable.

The probability density function for vonmisses in terms of its mode and dispersion parameter is :

for and . is the modified Bessel function of order 0.

__call__(mu, kappa, size=None, **kwargs)[source]

Draw samples from a von Mises distribution.

Signature¶

(), () -> ()

param mu: The mode of the distribution. The dispersion parameter of the distribution. Must be positive. Sample shape. If the given size is, e.g. (m, n, k) then m * n * k independent, identically distributed random variables are returned. Default is None in which case a single random variable is returned.
class aesara.tensor.random.basic.WaldRV(name=None, ndim_supp=None, ndims_params=None, dtype=None, inplace=None)[source]

A Wald (or inverse Gaussian) continuous random variable.

The probability density function for wald in terms of its mean parameter and shape parameter is:

for , where and .

__call__(mean=1.0, scale=1.0, size=None, **kwargs)[source]

Draw samples from a Wald distribution.

Signature¶

(), () -> ()

param mean: Mean parameter of the distribution. Must be positive. Shape parameter of the distribution. Must be positive. Sample shape. If the given size is (m, n, k), then m * n * k independent, identically distributed samples are returned. Default is None, in which case a single sample is returned.
class aesara.tensor.random.basic.WeibullRV(name=None, ndim_supp=None, ndims_params=None, dtype=None, inplace=None)[source]

A weibull continuous random variable.

The probability density function for weibull in terms of its shape parameter is :

for and .

__call__(shape, size=None, **kwargs)[source]

Draw samples from a weibull distribution.

Signature¶

() -> ()

param shape: The shape of the distribution. Must be positive. Sample shape. If the given size is, e.g. (m, n, k) then m * n * k independent, identically distributed random variables are returned. Default is None` in which case a single random variable is returned.