SourcePro® API Reference Guide

Product Documentation:
   SourcePro
Documentation Home
Classes | Functions

Module Description

The Essential Math Statistics classes provide random number generators for a variety of probability distributions.

Classes

class  Histogram
 Constructs and maintains a histogram of input data. More...
 
class  LeastSqFit
 Constructs a linear least squares fit to a straight line from input data. More...
 
class  RWRandGenBasicMLC
 Abstract base class for classes that generate random numbers uniformly distributed over the interval [0,1]. More...
 
class  RWRandGenerator
 Generates random numbers uniformly distributed over the interval [0, 1]. More...
 
class  RWRandGenMCG31M1
 Generates random numbers uniformly distributed over the interval [0, 1]. More...
 
class  RWRandGenMCG59
 Generates random numbers uniformly distributed over the interval [0, 1]. More...
 
class  RWRandGenMRG32K3A
 Generates random numbers uniformly distributed over the interval [0, 1]. More...
 
class  RWRandGenMTwist
 Generates random numbers uniformly distributed over the interval [0, 1]. More...
 
class  RWRandGenR250
 Generates random numbers uniformly distributed over the interval [0, 1]. More...
 
class  RWRandInterface
 Abstract base class for RWTRand. More...
 
class  RWTRand< Generator >
 Abstract base class from which the random number generator classes derive. More...
 
class  RWTRandBinomial< Generator >
 Used to generate random numbers from a binomial distribution. More...
 
class  RWTRandExponential< Generator >
 Used to generate random numbers from an exponential distribution. More...
 
class  RWTRandGamma< Generator >
 Used to generate random numbers from a gamma distribution. More...
 
class  RWTRandNormal< Generator >
 Used to generate random numbers from a normal distribution. More...
 
class  RWTRandPoisson< Generator >
 Used to generate random numbers from a Poisson distribution. More...
 
class  RWTRandUniform< Generator >
 Used to generate random numbers from a uniform distribution in an interval [a, b]. More...
 

Functions

double beta (double w, double z)
 
double binomialPF (size_t m, size_t N, double p)
 
double exponentialPF (double x, double a)
 
double factorial (size_t n)
 
double gaussianPF (double x, double m, double s)
 
double logGamma (double x)
 
double lorentzianPF (double x, double m, double w)
 
double poissonPF (size_t n, double m)
 
double rwEpslon (double x)
 

Function Documentation

double beta ( double  w,
double  z 
)
Header File
1 #include <rw/dstats.h>

Returns the Beta function:

\[ Beta(z,w) = \int\limits_0^1t^{z-1}(1-t)^{w-1}dt \]

double binomialPF ( size_t  m,
size_t  N,
double  p 
)
Header File
1 #include <rw/dstats.h>

The function binomialPF() returns the binomial probability coefficient. If an event has a probability p of occurring and we make N tries, binomialPF() returns the probability that the event will occur m times:

\[ \frac{N!}{(N-m)!m!}p^m(1-p)^{N-m} \]

double exponentialPF ( double  x,
double  a 
)
Header File
1 #include <rw/dstats.h>

Returns the exponential probability function. The quantity x / a has the probability distribution a exp(-ax).

double factorial ( size_t  n)
inline
Header File
1 #include <rw/dstats.h>

Returns the factorial of n, which is written n!. Stores previously calculated factorials internally for speed.

double gaussianPF ( double  x,
double  m,
double  s 
)
Header File
1 #include <rw/dstats.h>

Returns the Gaussian probability function for Gaussian mean m and standard deviation s:

\[ \text{Z}(x) = \frac{1}{s\sqrt{2\pi}} \exp \left ( \frac{(x-m)^2}{2s^2} \right ) \]

double logGamma ( double  x)
Header File
1 #include <rw/dstats.h>

Returns the natural log of the gamma function \( \Gamma(x) \), where:

\[ \Gamma (x) = \int_{0}^{\infty} \text{t}^{x-1} \text{e}^{-t} \text{dt} \]

double lorentzianPF ( double  x,
double  m,
double  w 
)
Header File
1 #include <rw/dstats.h>

Returns the Lorentzian probability function, where m is the mean of the distribution and w is the full width at half maximum of the distribution.

double poissonPF ( size_t  n,
double  m 
)
Header File
1 #include <rw/dstats.h>

The Poisson distribution gives the probability of a certain integer number of unit rate Poisson random events occurring in a given time interval. The Poisson distribution represents an approximation to the binomial distribution for the special case where the average number of events is very much smaller than the possible number. The function poissonPF() returns the probability that a Poisson random event with Poisson mean m will occur, given n observations:

\[ \frac{m^n e}{n!} \frac{m^n e^{-m}}{n!} \]

double rwEpslon ( double  x)
Header File
1 #include <rw/dstats.h>

Returns an estimate of the machine roundoff error in units of x, typically 1. This is frequently used to determine whether a number is near 0 relative to other numbers of order x.

Copyright © 2021 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.