src/main/cpp/numerics4cpp/statistics/distribution/saddle.h File Reference

#include "../../numerics.h"

Go to the source code of this file.

Functions

double stirling_error (double z)
double saddle_deviance_part (double x, double mu)
double log_binomial_pmf (int x, int n, double p, double q)


Detailed Description

Utility functions used by various distributions to accurately compute their respective probability mass functions. The implementation for these functions is based on the Catherine Loader's dbinom routines.

These functions are not intended to be called directly.

References:

  1. Catherine Loader (2000). "Fast and Accurate Computation of Binomial Probabilities.". http://www.herine.net/stat/papers/dbinom.pdf

Function Documentation

double log_binomial_pmf ( int  x,
int  n,
double  p,
double  q 
)

Compute the PMF for a binomial distribution using the saddle point expansion.

Parameters:
x the value at which the probability is evaluated.
n the number of trials.
p the probability of success.
q the probability of failure (1 - p).
Returns:
log(p(x)).

double saddle_deviance_part ( double  x,
double  mu 
)

A part of the deviance portion of the saddle point approximation.

References:

  1. Catherine Loader (2000). "Fast and Accurate Computation of Binomial Probabilities.". http://www.herine.net/stat/papers/dbinom.pdf

Parameters:
x the x value.
mu the average.
Returns:
a part of the deviance.

double stirling_error ( double  z  ) 

Compute the error of Stirling's series at the given value.

References:

  1. Eric W. Weisstein. "Stirling's Series." From MathWorld--A Wolfram Web Resource. http://mathworld.wolfram.com/StirlingsSeries.html

Parameters:
z the value.
Returns:
the Striling's series error.


Generated on Wed Nov 21 22:22:15 2007 for numerics4c++ by  doxygen 1.5.3