Main Page   Alphabetical List   Compound List   File List   Compound Members   File Members  

cdf.h File Reference

Routine collection for estimating cumulative distribution functions. More...

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <float.h>

Include dependency graph for cdf.h:

Include dependency graph

Go to the source code of this file.

Compounds

struct  Cdfrec_
 Cdfrec_ : this structure holds the variables for estimating a CDF. More...


Functions

int init_cdf (int Binno, double Low, double Up, Cdfrec_ *Cdf)
 init_cdf(Binno, Low, Up, Cdf): initialises Cdf to collect data between Low and Up into Binno bins. More...

int add_cdf (double Value, Cdfrec_ *Cdf)
 add_cdf(Value, Cdf): enters the value Value into Cdf. More...

int eval_cdf (Cdfrec_ *Cdf)
 eval_cdf(Cdf): calculates the CDF and puts the estimated values in Cdf->Y[] (a normalisation). More...

void remove_cdf (Cdfrec_ *Cdf)
 remove_cdf(Cdf): frees up the 3 arrays in Cdfrec_ and resets all variables to 0. More...


Detailed Description

Routine collection for estimating cumulative distribution functions.

Definition in file cdf.h.


Function Documentation

int init_cdf ( int Binno,
double Low,
double Up,
Cdfrec_ * Cdf )
 

init_cdf(Binno, Low, Up, Cdf): initialises Cdf to collect data between Low and Up into Binno bins.

X[] is initialised to uniform sampling but the user can overwrite it after the call to init_cdf(), the only rule being that if i<j then X[i]<=X[j]. If Low>Up, they are silently swapped. In C++ this would be a constructor. Return value: 0 if OK, -1 if some of the parameters were silly, -2 if no more memory could be allocated.

Referenced by Cdfrec_::N().

int add_cdf ( double Value,
Cdfrec_ * Cdf )
 

add_cdf(Value, Cdf): enters the value Value into Cdf.

The bin which is the first that is higher than Value is incremented by 1. Return value: 0 if OK, 1 if it is too large.

Referenced by Cdfrec_::N().

int eval_cdf ( Cdfrec_ * Cdf )
 

eval_cdf(Cdf): calculates the CDF and puts the estimated values in Cdf->Y[] (a normalisation).

Leaves the original Cdf->Yint[] intact. Return value: 0 if OK, -1 if no data were in Cdf.

Referenced by Cdfrec_::N().

void remove_cdf ( Cdfrec_ * Cdf )
 

remove_cdf(Cdf): frees up the 3 arrays in Cdfrec_ and resets all variables to 0.

Does not remove Cdf itself! This would be a C++ destructor.

Referenced by Cdfrec_::N().


Generated at Wed Aug 21 09:33:29 2002 for The Razorback C Library: Statistics by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001