Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Class template non_central_chi_squared_distribution

boost::random::non_central_chi_squared_distribution

Synopsis

// In header: <boost/random/non_central_chi_squared_distribution.hpp>

template<typename RealType> 
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 ;

    // public member functions
    (RealType = , RealType = );
    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 &);
  };

  // public member functions
  (RealType = , RealType = );
  (const  param_type &);
  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 &);
};

Description

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 member functions

  1. (RealType k = , 
                                                  RealType lambda = );

    Construct a non_central_chi_squared_distribution object. k and lambda are the parameter of the distribution.

    Requires: k > 0 && lambda > 0

  2. (const  param_type & param);

    Construct a non_central_chi_squared_distribution object from the parameter.

  3. template<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.

  4. template<typename URNG> RealType (URNG & eng);

    Returns a random variate distributed according to the non central chi squared distribution.

  5. RealType () ;

    Returns the k parameter of the distribution.

  6. RealType () ;

    Returns the lambda parameter of the distribution.

  7. param_type () ;

    Returns the parameters of the distribution.

  8. void (const  param_type & param);

    Sets parameters of the distribution.

  9. void ();

    Resets the distribution, so that subsequent uses does not depend on values already produced by it.

  10. RealType () ;

    Returns the smallest value that the distribution can produce.

  11. RealType () ;

    Returns the largest value that the distribution can produce.

non_central_chi_squared_distribution friend functions

  1. template<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.

  2. 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.

  3. 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.

  4. 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.


PrevUpHomeNext