tmp/tmpezks_cm0/{from.md → to.md}
RENAMED
|
@@ -1,25 +1,22 @@
|
|
| 1 |
##### Class template `chi_squared_distribution` <a id="rand.dist.norm.chisq">[[rand.dist.norm.chisq]]</a>
|
| 2 |
|
| 3 |
A `chi_squared_distribution` random number distribution produces random
|
| 4 |
numbers x > 0 distributed according to the probability density function
|
| 5 |
-
$$
|
| 6 |
-
p(x\,|\,n)
|
| 7 |
-
= \frac{ x^{(n/2)-1} \cdot e^{-x/2}}
|
| 8 |
-
{\Gamma(n/2) \cdot 2^{n/2}}
|
| 9 |
-
\; \mbox{.}$$
|
| 10 |
|
| 11 |
``` cpp
|
| 12 |
template<class RealType = double>
|
| 13 |
class chi_squared_distribution {
|
| 14 |
public:
|
| 15 |
// types
|
| 16 |
using result_type = RealType;
|
| 17 |
using param_type = unspecified;
|
| 18 |
|
| 19 |
// constructor and reset functions
|
| 20 |
-
|
|
|
|
| 21 |
explicit chi_squared_distribution(const param_type& parm);
|
| 22 |
void reset();
|
| 23 |
|
| 24 |
// generating functions
|
| 25 |
template<class URBG>
|
|
@@ -35,17 +32,16 @@ template<class RealType = double>
|
|
| 35 |
result_type max() const;
|
| 36 |
};
|
| 37 |
```
|
| 38 |
|
| 39 |
``` cpp
|
| 40 |
-
explicit chi_squared_distribution(RealType n
|
| 41 |
```
|
| 42 |
|
| 43 |
-
*
|
| 44 |
|
| 45 |
-
*
|
| 46 |
-
corresponds to the parameter of the distribution.
|
| 47 |
|
| 48 |
``` cpp
|
| 49 |
RealType n() const;
|
| 50 |
```
|
| 51 |
|
|
|
|
| 1 |
##### Class template `chi_squared_distribution` <a id="rand.dist.norm.chisq">[[rand.dist.norm.chisq]]</a>
|
| 2 |
|
| 3 |
A `chi_squared_distribution` random number distribution produces random
|
| 4 |
numbers x > 0 distributed according to the probability density function
|
| 5 |
+
$$p(x\,|\,n) = \frac{x^{(n/2)-1} \cdot e^{-x/2}}{\Gamma(n/2) \cdot 2^{n/2}} \text{ .}$$
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
``` cpp
|
| 8 |
template<class RealType = double>
|
| 9 |
class chi_squared_distribution {
|
| 10 |
public:
|
| 11 |
// types
|
| 12 |
using result_type = RealType;
|
| 13 |
using param_type = unspecified;
|
| 14 |
|
| 15 |
// constructor and reset functions
|
| 16 |
+
chi_squared_distribution() : chi_squared_distribution(1.0) {}
|
| 17 |
+
explicit chi_squared_distribution(RealType n);
|
| 18 |
explicit chi_squared_distribution(const param_type& parm);
|
| 19 |
void reset();
|
| 20 |
|
| 21 |
// generating functions
|
| 22 |
template<class URBG>
|
|
|
|
| 32 |
result_type max() const;
|
| 33 |
};
|
| 34 |
```
|
| 35 |
|
| 36 |
``` cpp
|
| 37 |
+
explicit chi_squared_distribution(RealType n);
|
| 38 |
```
|
| 39 |
|
| 40 |
+
*Preconditions:* 0 < `n`.
|
| 41 |
|
| 42 |
+
*Remarks:* `n` corresponds to the parameter of the distribution.
|
|
|
|
| 43 |
|
| 44 |
``` cpp
|
| 45 |
RealType n() const;
|
| 46 |
```
|
| 47 |
|