#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <float.h>
Include dependency graph for pdf2.h:
Go to the source code of this file.
Compounds | |
struct | Pdfrec2_ |
Pdfrec2_ : this structure holds the variables for estimating a joint PDF of 2 random variables. More... | |
Functions | |
int | init_pdf2 (int Binno1, int Binno2, double Binwidth1, double Binwidth2, double Low1, double Up1, double Low2, double Up2, Pdfrec2_ *Pdf) |
init_pdf2(Binno1, Binno2, Binwidth1, Binwidth2, Low1, Up1, Low2, Up2, Pdf): sets up Pdf for accepting raw data. More... | |
int | add_pdf2 (double Value1, double Value2, Pdfrec2_ *Pdf) |
add_pdf2(Value1, Value2, Pdf): enters the value pair Value1,2 into Pdf. More... | |
int | eval_pdf2 (Pdfrec2_ *Pdf) |
eval_pdf2(Pdf): calculates the PDF and puts the estimated values in Pdf->Y[][] (a normalisation). More... | |
void | remove_pdf2 (Pdfrec2_ *Pdf) |
remove_pdf2(Pdf): frees up the arrays in Pdfrec_ and resets all variables to 0. More... |
Definition in file pdf2.h.
|
init_pdf2(Binno1, Binno2, Binwidth1, Binwidth2, Low1, Up1, Low2, Up2, Pdf): sets up Pdf for accepting raw data. Binno1,2 are the bin numbers, Binwidth1, 2 are the bin widths for variables 1 and 2. The range will be Low[12]..Up[12] (everything outside is ignored. It is assumed that Pdf is either empty or has been cleared. Return value: 0 if OK, -1 if some of the parameters make no sense, -2 if memory could not be allocated. Referenced by Pdfrec2_::N(). |
|
add_pdf2(Value1, Value2, Pdf): enters the value pair Value1,2 into Pdf. All bins in Pdf->Yint[][] which lie closer to Value1, 2 than the half of the bin widths get incremented by 1 (the "sliding bin" idea by Willie) and the total data count Pdf->N is incremented by 1. Return value: 0 if OK, -1 if Value-s are too small, 1 if they are too large. Referenced by Pdfrec2_::N(). |
|
eval_pdf2(Pdf): calculates the PDF and puts the estimated values in Pdf->Y[][] (a normalisation). Return value: 0 if OK, -1 if no data were in Pdf. Referenced by Pdfrec2_::N(). |
|
remove_pdf2(Pdf): frees up the arrays in Pdfrec_ and resets all variables to 0. Does not remove Pdf itself! This would be a C++ destructor. Referenced by Pdfrec2_::N(). |