From Jason Turner

[rand.dist]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpi8ullemh/{from.md → to.md} +8 -10
tmp/tmpi8ullemh/{from.md → to.md} RENAMED
@@ -205,11 +205,11 @@ constructed.
205
 
206
  A `binomial_distribution` random number distribution produces integer
207
  values i ≥ 0 distributed according to the discrete probability function
208
  $$%
209
  P(i\,|\,t,p)
210
- = {t \choose i} \cdot p^i \cdot (1-p)^{t-i}
211
  \; \mbox{.}$$
212
 
213
  ``` cpp
214
  template<class IntType = int>
215
  class binomial_distribution
@@ -321,11 +321,11 @@ constructed.
321
 
322
  A `negative_binomial_distribution` random number distribution produces
323
  random integers i ≥ 0 distributed according to the discrete probability
324
  function $$%
325
  P(i\,|\,k,p)
326
- = {k+i-1 \choose i} \cdot p^k \cdot (1-p)^i
327
  \; \mbox{.}$$
328
 
329
  ``` cpp
330
  template<class IntType = int>
331
  class negative_binomial_distribution
@@ -495,13 +495,11 @@ constructed.
495
 
496
  A `gamma_distribution` random number distribution produces random
497
  numbers x > 0 distributed according to the probability density function
498
  $$%
499
  p(x\,|\,\alpha,\beta)
500
- = { e^{-x/\beta}
501
- \over {\beta^{\alpha} \cdot \Gamma(\alpha)}
502
- }
503
  \, \cdot \, x^{\, \alpha-1}
504
  \; \mbox{.}$$
505
 
506
  ``` cpp
507
  template<class RealType = double>
@@ -575,11 +573,11 @@ public:
575
  // types
576
  typedef RealType result_type;
577
  typedef unspecified param_type;
578
 
579
  // constructor and reset functions
580
- explicit weibull_distribution(RealType a = 1.0, RealType b = 1.0)
581
  explicit weibull_distribution(const param_type& parm);
582
  void reset();
583
 
584
  // generating functions
585
  template<class URNG>
@@ -690,11 +688,11 @@ constructed.
690
  ##### Class template `normal_distribution` <a id="rand.dist.norm.normal">[[rand.dist.norm.normal]]</a>
691
 
692
  A `normal_distribution` random number distribution produces random
693
  numbers x distributed according to the probability density function $$%
694
  p(x\,|\,\mu,\sigma)
695
- = {1 \over \sigma \sqrt{2\pi}}
696
  \cdot
697
  % e^{-(x-\mu)^2 / (2\sigma^2)}
698
  \exp{\left(- \, \frac{(x - \mu)^2}
699
  {2 \sigma^2}
700
  \right)
@@ -1184,11 +1182,11 @@ $$%
1184
  The n+1 distribution parameters bᵢ, also known as this distribution’s
1185
  *interval boundaries* , shall satisfy the relation bᵢ < bᵢ₊₁ for
1186
  i = 0, …, n-1. Unless specified otherwise, the remaining n distribution
1187
  parameters are calculated as: $$%
1188
  \rho_k = \;
1189
- {w_k \over {S \cdot (b_{k+1}-b_k)}}
1190
  \; \mbox{ for } k = 0, \ldots, n\!-\!1,$$ in which the values wₖ,
1191
  commonly known as the *weights* , shall be non-negative, non-NaN, and
1192
  non-infinity. Moreover, the following relation shall hold:
1193
  0 < S = w₀ + ⋯ + wₙ₋₁.
1194
 
@@ -1312,12 +1310,12 @@ k = 0, …, n-1.
1312
 
1313
  A `piecewise_linear_distribution` random number distribution produces
1314
  random numbers x, b₀ ≤ x < bₙ, distributed over each subinterval
1315
  [ bᵢ, bᵢ₊₁ ) according to the probability density function $$%
1316
  p(x\,|\,b_0,\ldots,b_n,\;\rho_0,\ldots,\rho_n)
1317
- = \rho_i \cdot {{b_{i+1} - x} \over {b_{i+1} - b_i}}
1318
- + \rho_{i+1} \cdot {{x - b_i} \over {b_{i+1} - b_i}}
1319
  \; \mbox{,}
1320
  \mbox{ for } b_i \le x < b_{i+1}
1321
  \; \mbox{.}$$
1322
 
1323
  The n+1 distribution parameters bᵢ, also known as this distribution’s
 
205
 
206
  A `binomial_distribution` random number distribution produces integer
207
  values i ≥ 0 distributed according to the discrete probability function
208
  $$%
209
  P(i\,|\,t,p)
210
+ = \binom{t}{i} \cdot p^i \cdot (1-p)^{t-i}
211
  \; \mbox{.}$$
212
 
213
  ``` cpp
214
  template<class IntType = int>
215
  class binomial_distribution
 
321
 
322
  A `negative_binomial_distribution` random number distribution produces
323
  random integers i ≥ 0 distributed according to the discrete probability
324
  function $$%
325
  P(i\,|\,k,p)
326
+ = \binom{k+i-1}{i} \cdot p^k \cdot (1-p)^i
327
  \; \mbox{.}$$
328
 
329
  ``` cpp
330
  template<class IntType = int>
331
  class negative_binomial_distribution
 
495
 
496
  A `gamma_distribution` random number distribution produces random
497
  numbers x > 0 distributed according to the probability density function
498
  $$%
499
  p(x\,|\,\alpha,\beta)
500
+ = \frac{e^{-x/\beta}}{\beta^{\alpha} \cdot \Gamma(\alpha)}
 
 
501
  \, \cdot \, x^{\, \alpha-1}
502
  \; \mbox{.}$$
503
 
504
  ``` cpp
505
  template<class RealType = double>
 
573
  // types
574
  typedef RealType result_type;
575
  typedef unspecified param_type;
576
 
577
  // constructor and reset functions
578
+ explicit weibull_distribution(RealType a = 1.0, RealType b = 1.0);
579
  explicit weibull_distribution(const param_type& parm);
580
  void reset();
581
 
582
  // generating functions
583
  template<class URNG>
 
688
  ##### Class template `normal_distribution` <a id="rand.dist.norm.normal">[[rand.dist.norm.normal]]</a>
689
 
690
  A `normal_distribution` random number distribution produces random
691
  numbers x distributed according to the probability density function $$%
692
  p(x\,|\,\mu,\sigma)
693
+ = \frac{1}{\sigma \sqrt{2\pi}}
694
  \cdot
695
  % e^{-(x-\mu)^2 / (2\sigma^2)}
696
  \exp{\left(- \, \frac{(x - \mu)^2}
697
  {2 \sigma^2}
698
  \right)
 
1182
  The n+1 distribution parameters bᵢ, also known as this distribution’s
1183
  *interval boundaries* , shall satisfy the relation bᵢ < bᵢ₊₁ for
1184
  i = 0, …, n-1. Unless specified otherwise, the remaining n distribution
1185
  parameters are calculated as: $$%
1186
  \rho_k = \;
1187
+ \frac{w_k}{S \cdot (b_{k+1}-b_k)}
1188
  \; \mbox{ for } k = 0, \ldots, n\!-\!1,$$ in which the values wₖ,
1189
  commonly known as the *weights* , shall be non-negative, non-NaN, and
1190
  non-infinity. Moreover, the following relation shall hold:
1191
  0 < S = w₀ + ⋯ + wₙ₋₁.
1192
 
 
1310
 
1311
  A `piecewise_linear_distribution` random number distribution produces
1312
  random numbers x, b₀ ≤ x < bₙ, distributed over each subinterval
1313
  [ bᵢ, bᵢ₊₁ ) according to the probability density function $$%
1314
  p(x\,|\,b_0,\ldots,b_n,\;\rho_0,\ldots,\rho_n)
1315
+ = \rho_i \cdot {\frac{b_{i+1} - x}{b_{i+1} - b_i}}
1316
+ + \rho_{i+1} \cdot {\frac{x - b_i}{b_{i+1} - b_i}}
1317
  \; \mbox{,}
1318
  \mbox{ for } b_i \le x < b_{i+1}
1319
  \; \mbox{.}$$
1320
 
1321
  The n+1 distribution parameters bᵢ, also known as this distribution’s