![]() |
Home | Libraries | People | FAQ | More |
boost::random::non_central_chi_squared_distribution
// In header: <boost/random/non_central_chi_squared_distribution.hpp> template<typename RealType = double> class non_central_chi_squared_distribution { public: // types typedef RealType ; typedef RealType ; // member classes/structs/unions class param_type { public: // types typedef non_central_chi_squared_distribution ; // construct/copy/destruct (RealType = , RealType = ); // public member functions RealType () ; RealType () ; // friend functions template<typename CharT, typename Traits> CharT, Traits > & (CharT, Traits > &, const param_type &); template<typename CharT, typename Traits> CharT, Traits > & (CharT, Traits > &, const param_type &); bool (const param_type &, const param_type &); bool (const param_type &, const param_type &); }; // construct/copy/destruct (RealType = , RealType = ); (const param_type &); // public member functions template<typename URNG> RealType (URNG &, const param_type &) ; template<typename URNG> RealType (URNG &); RealType () ; RealType () ; param_type () ; void (const param_type &); void (); RealType () ; RealType () ; // friend functions template<typename CharT, typename Traits> CharT, Traits > & (CharT, Traits > &, const non_central_chi_squared_distribution &); template<typename CharT, typename Traits> CharT, Traits > & (CharT, Traits > &, const non_central_chi_squared_distribution &); bool (const non_central_chi_squared_distribution &, const non_central_chi_squared_distribution &); bool (const non_central_chi_squared_distribution &, const non_central_chi_squared_distribution &); };
The noncentral chi-squared distribution is a real valued distribution with two parameter, k
and lambda
. The distribution produces values > 0.
This is the distribution of the sum of squares of k Normal distributed variates each with variance one and the sum of squares of the normal means.
The distribution function is . where
is a modified Bessel function of the first kind.
The algorithm is taken from
"Monte Carlo Methods in Financial Engineering", Paul Glasserman, 2003, XIII, 596 p, Stochastic Modelling and Applied Probability, Vol. 53, ISBN 978-0-387-21617-1, p 124, Fig. 3.5.
non_central_chi_squared_distribution
public
construct/copy/destruct(RealType k = , RealType lambda = );
Construct a
object. non_central_chi_squared_distribution
k
and lambda
are the parameter of the distribution.
Requires: k > 0 && lambda > 0
(const param_type & param);
Construct a
object from the parameter. non_central_chi_squared_distribution
non_central_chi_squared_distribution
public member functionstemplate<typename URNG> RealType (URNG & eng, const param_type & param) ;
Returns a random variate distributed according to the non central chi squared distribution specified by param
.
template<typename URNG> RealType (URNG & eng);
Returns a random variate distributed according to the non central chi squared distribution.
RealType () ;
Returns the k
parameter of the distribution.
RealType () ;
Returns the lambda
parameter of the distribution.
param_type () ;
Returns the parameters of the distribution.
void (const param_type & param);
Sets parameters of the distribution.
void ();
Resets the distribution, so that subsequent uses does not depend on values already produced by it.
RealType () ;
Returns the smallest value that the distribution can produce.
RealType () ;
Returns the largest value that the distribution can produce.
non_central_chi_squared_distribution
friend functionstemplate<typename CharT, typename Traits> CharT, Traits > & (CharT, Traits > & os, const non_central_chi_squared_distribution & dist);
Writes the parameters of the distribution to a std::ostream
.
template<typename CharT, typename Traits> CharT, Traits > & (CharT, Traits > & is, const non_central_chi_squared_distribution & dist);
reads the parameters of the distribution from a std::istream
.
bool (const non_central_chi_squared_distribution & lhs, const non_central_chi_squared_distribution & rhs);
Returns true if two distributions have the same parameters and produce the same sequence of random numbers given equal generators.
bool (const non_central_chi_squared_distribution & lhs, const non_central_chi_squared_distribution & rhs);
Returns true if two distributions have different parameters and/or can produce different sequences of random numbers given equal generators.