mxfusion.components.distributions.beta¶
Members¶
-
class
mxfusion.components.distributions.beta.
Beta
(alpha, beta, rand_gen=None, dtype=None, ctx=None)¶ Bases:
mxfusion.components.distributions.univariate.UnivariateDistribution
The one-dimensional beta distribution. The beta distribution can be defined over a scalar random variable or an array of random variables. In case of an array of random variables, a and b are broadcasted to the shape of the output random variable (array).
Parameters: - alpha (Variable) – a parameter (alpha) of the beta distribution.
- beta (Variable) – b parameter (beta) of the beta distribution.
- rand_gen (RandomGenerator) – the random generator (default: MXNetRandomGenerator).
- dtype (numpy.float32 or numpy.float64) – the data type for float point numbers.
- ctx (None or mxnet.cpu or mxnet.gpu) – the mxnet context (default: None/current context).
-
log_pdf_impl
(alpha, beta, random_variable, F=None)¶ Computes the logarithm of the probability density function (PDF) of the beta distribution.
Parameters: - alpha (MXNet NDArray or MXNet Symbol) – the a parameter (alpha) of the beta distribution.
- beta (MXNet NDArray or MXNet Symbol) – the b parameter (beta) of the beta distributions.
- random_variable (MXNet NDArray or MXNet Symbol) – the random variable of the beta distribution.
- F – the MXNet computation mode (mxnet.symbol or mxnet.ndarray).
Returns: log pdf of the distribution.
Rtypes: MXNet NDArray or MXNet Symbol
-
draw_samples_impl
(alpha, beta, rv_shape, num_samples=1, F=None)¶ Draw samples from the beta distribution.
If X and Y are independent, with $X sim Gamma(lpha, heta)$ and $Y sim Gamma(eta, heta)$ then $
rac {X}{X+Y}}sim mathrm {B} (lpha ,eta ).}$
param alpha: the a parameter (alpha) of the beta distribution. type alpha: MXNet NDArray or MXNet Symbol param beta: the b parameter (beta) of the beta distributions. type beta: MXNet NDArray or MXNet Symbol param rv_shape: the shape of each sample. type rv_shape: tuple param num_samples: the number of drawn samples (default: one). type num_samples: int param F: the MXNet computation mode (mxnet.symbol or mxnet.ndarray). returns: a set samples of the beta distribution. rtypes: MXNet NDArray or MXNet Symbol
-
static
define_variable
(alpha=1.0, beta=1.0, shape=None, rand_gen=None, dtype=None, ctx=None)¶ Creates and returns a random variable drawn from a beta distribution.
Parameters: - a – The a parameter (alpha) of the distribution.
- b – The b parameter (beta) of the distribution.
- shape (tuple or [tuple]) – the shape of the random variable(s).
- rand_gen (RandomGenerator) – the random generator (default: MXNetRandomGenerator).
- dtype (numpy.float32 or numpy.float64) – the data type for float point numbers.
- ctx (None or mxnet.cpu or mxnet.gpu) – the mxnet context (default: None/current context).
Returns: the random variables drawn from the beta distribution.
Rtypes: Variable