cppannotations/yo/stl/chisquared.yo
2010-12-19 10:51:50 +00:00

40 lines
1.4 KiB
Text

The ti(chi_squared_distribution<RealType = double>) with tt(n) degrees of
freedom is the distribution of a sum of the squares of tt(n) independent
standard normal random variables.
Note that even though the distribution's parameter tt(n) usually is an
integral value, it doesn't have to be integral, as the chi_squared
distribution is defined in terms of functions (tt(exp) and tt(Gamma)) that
take real arguments (see, e.g., the formula shown in the tt(<bits/random.h>)
header file, provided with the Gnu tt(g++) compiler distribution).
The chi-squared distribution is used, e.g., when testing the goodness of fit
of an observed distribution to a theoretical one.
Defined types:
verb(
typedef RealType result_type;
struct param_type
{
explicit param_type(RealType n = RealType(1));
RealType n() const;
};
)
Constructors and members:
itemization(
itt(chi_squared_distribution<>(RealType n = 1))
constructs a chi_squared distribution with specified number of degrees
of freedom.
itt(chi_squared_distribution<>(param_type const &param))
constructs a chi_squared distribution according to the value stored in
the tt(param) struct;
itt(IntType n() const)nl()
returns the distribution's degrees of freedom;
itt(result_type min() const)nl()
returns 0;
itt(result_type max() const)nl()
returns the maximum value of tt(result_type);
)