Lines Matching full:beta
35 // Generate a floating-point variate conforming to a Beta distribution:
36 // pdf(x) \propto x^(alpha-1) * (1-x)^(beta-1),
37 // where the params alpha and beta are both strictly positive real values.
40 // to 0 or 1, due to numerical errors when alpha and beta are very different.
42 // Usage note: One usage is that alpha and beta are counts of number of
44 // approximating a beta distribution with a Gaussian distribution with the same
46 // smaller of alpha and beta when the number of trials are sufficiently large,
47 // to quantify how far a beta distribution is from the normal distribution.
57 explicit param_type(result_type alpha, result_type beta) in param_type() argument
58 : alpha_(alpha), beta_(beta) { in param_type()
60 assert(beta >= 0); in param_type()
62 assert(beta <= (std::numeric_limits<result_type>::max)()); in param_type()
63 if (alpha == 0 || beta == 0) { in param_type()
65 x_ = (alpha >= beta) ? 1 : 0; in param_type()
68 // a_ = min(beta, alpha), b_ = max(beta, alpha). in param_type()
69 if (beta < alpha) { in param_type()
71 a_ = beta; in param_type()
76 b_ = beta; in param_type()
84 // Evaluation of Beta Generation Algorithms, Ying-Chao Hung, et. al. in param_type()
121 result_type beta() const { return beta_; } in beta() function
171 // Hung et al. Evaluation of beta generation algorithms. Communications
174 // Zechner, Heinz, and Ernst Stadlober. Generating beta variates via
184 result_type a_; // the smaller of {alpha, beta}, or 1.0/alpha_ in JOEHNK
185 result_type b_; // the larger of {alpha, beta}, or 1.0/beta_ in JOEHNK
186 result_type x_; // alpha + beta, or the result in degenerate cases
188 result_type y_; // "beta" in Cheng
204 explicit beta_distribution(result_type alpha, result_type beta = 1)
205 : param_(alpha, beta) {} in param_() argument
228 result_type beta() const { return param_.beta(); } in beta() function
307 // When both alpha and beta are small, x and y are both close to 0, so in AlgorithmJoehnk()
343 // Based on Cheng, Russell CH. Generating beta variates with nonintegral in AlgorithmCheng()
402 os << x.alpha() << os.fill() << x.beta();
412 result_type alpha, beta; variable
417 beta = random_internal::read_floating_point<result_type>(is);
419 x.param(param_type(alpha, beta));