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  ;
  typedef  ; 

  // member classes/structs/unions

  class param_type {
  public:
    // types
    typedef non_central_chi_squared_distribution ;

    // construct/copy/destruct
    ( = ,  = );

    // public member functions
     () ;
     () ;

    // friend functions
    template<typename CharT, typename Traits> 
       
      (, param_type &);
    template<typename CharT, typename Traits> 
       
      (, param_type &);
     (param_type &, param_type &);
     (param_type &, param_type &);
  };

  // construct/copy/destruct
  ( = ,  = );
  (param_type &);

  // public member functions
  template<typename URNG> 
     (, param_type &) ;
  template<typename URNG>  ();
   () ;
   () ;
  param_type () ;
   (param_type &);
   ();
   () ;
   () ;

  // friend functions
  template<typename CharT, typename Traits> 
     
    (, 
               non_central_chi_squared_distribution &);
  template<typename CharT, typename Traits> 
     
    (, 
               non_central_chi_squared_distribution &);
   (non_central_chi_squared_distribution &, 
                  non_central_chi_squared_distribution &);
   (non_central_chi_squared_distribution &, 
                  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 construct/copy/destruct

  1. ( k = , 
                                                   lambda = );

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

    Requires: k > 0 && lambda > 0

  2. (param_type & param);

    Construct a non_central_chi_squared_distribution object from the parameter.

non_central_chi_squared_distribution public member functions

  1. template<typename URNG> 
       ( eng, param_type & param) ;

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

  2. template<typename URNG>  ( eng);

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

  3.  () ;

    Returns the k parameter of the distribution.

  4.  () ;

    Returns the lambda parameter of the distribution.

  5. param_type () ;

    Returns the parameters of the distribution.

  6.  (param_type & param);

    Sets parameters of the distribution.

  7.  ();

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

  8.  () ;

    Returns the smallest value that the distribution can produce.

  9.  () ;

    Returns the largest value that the distribution can produce.

non_central_chi_squared_distribution friend functions

  1. template<typename CharT, typename Traits> 
       
      ( os, 
                 non_central_chi_squared_distribution & dist);

    Writes the parameters of the distribution to a std::ostream.

  2. template<typename CharT, typename Traits> 
       
      ( is, 
                 non_central_chi_squared_distribution & dist);

    reads the parameters of the distribution from a std::istream.

  3.  (non_central_chi_squared_distribution & lhs, 
                    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.  (non_central_chi_squared_distribution & lhs, 
                    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