Base for classes with test whether data could come from a given pdf. More...
#include <pdf1d_compare_to_pdf.h>
Public Member Functions | |
pdf1d_compare_to_pdf () | |
Dflt ctor. | |
virtual | ~pdf1d_compare_to_pdf () |
Destructor. | |
virtual double | compare (const double *data, int n, const pdf1d_pdf &pdf)=0 |
Test whether data came from the given distribution. | |
virtual double | bootstrap_compare (vnl_vector< double > &B, const double *data, int n, const pdf1d_pdf &pdf, int n_trials) |
Test whether data came from the given distribution, using bootstrap. | |
virtual double | compare_form (const double *data, int n, const pdf1d_builder &builder) |
Test whether data has form of the given distribution. | |
virtual double | bootstrap_compare_form (vnl_vector< double > &B, const double *data, int n, const pdf1d_builder &builder, int n_trials) |
Test whether data has form of the given distribution. | |
short | version_no () const |
Version number for I/O. | |
virtual vcl_string | is_a () const |
Name of the class. | |
virtual bool | is_class (vcl_string const &s) const |
Does the name of the class match the argument?. | |
virtual pdf1d_compare_to_pdf * | clone () const =0 |
Create a copy on the heap and return base class pointer. | |
virtual void | print_summary (vcl_ostream &os) const =0 |
Print class to os. | |
virtual void | b_write (vsl_b_ostream &bfs) const =0 |
Save class to binary file stream. | |
virtual void | b_read (vsl_b_istream &bfs)=0 |
Load class from binary file stream. | |
Protected Attributes | |
mbl_cloneable_ptr< pdf1d_pdf > | pdf_ |
Workspace for PDFs. |
Base for classes with test whether data could come from a given pdf.
Functions are available to test whether a set of samples are likely to have been drawn from either a particular distribution or a given form of distribution.
Definition at line 24 of file pdf1d_compare_to_pdf.h.
pdf1d_compare_to_pdf::pdf1d_compare_to_pdf | ( | ) |
Dflt ctor.
Definition at line 18 of file pdf1d_compare_to_pdf.cxx.
pdf1d_compare_to_pdf::~pdf1d_compare_to_pdf | ( | ) | [virtual] |
Destructor.
Definition at line 26 of file pdf1d_compare_to_pdf.cxx.
virtual void pdf1d_compare_to_pdf::b_read | ( | vsl_b_istream & | bfs | ) | [pure virtual] |
Load class from binary file stream.
Implemented in pdf1d_compare_to_pdf_bhat, and pdf1d_compare_to_pdf_ks.
virtual void pdf1d_compare_to_pdf::b_write | ( | vsl_b_ostream & | bfs | ) | const [pure virtual] |
Save class to binary file stream.
Implemented in pdf1d_compare_to_pdf_bhat, and pdf1d_compare_to_pdf_ks.
double pdf1d_compare_to_pdf::bootstrap_compare | ( | vnl_vector< double > & | B, |
const double * | data, | ||
int | n, | ||
const pdf1d_pdf & | pdf, | ||
int | n_trials | ||
) | [virtual] |
Test whether data came from the given distribution, using bootstrap.
Repeatedly resamples n values from data[0..n-1] and compares with the given pdf. Individual comparisons are returned in B.
Definition at line 35 of file pdf1d_compare_to_pdf.cxx.
double pdf1d_compare_to_pdf::bootstrap_compare_form | ( | vnl_vector< double > & | B, |
const double * | data, | ||
int | n, | ||
const pdf1d_builder & | builder, | ||
int | n_trials | ||
) | [virtual] |
Test whether data has form of the given distribution.
Repeatedly resamples n values from data[0..n-1] and calls compare_form(). Individual comparisons are returned in B.
Reimplemented in pdf1d_compare_to_pdf_bhat.
Definition at line 75 of file pdf1d_compare_to_pdf.cxx.
virtual pdf1d_compare_to_pdf* pdf1d_compare_to_pdf::clone | ( | ) | const [pure virtual] |
Create a copy on the heap and return base class pointer.
Implemented in pdf1d_compare_to_pdf_bhat, and pdf1d_compare_to_pdf_ks.
virtual double pdf1d_compare_to_pdf::compare | ( | const double * | data, |
int | n, | ||
const pdf1d_pdf & | |||
) | [pure virtual] |
Test whether data came from the given distribution.
Implemented in pdf1d_compare_to_pdf_bhat, and pdf1d_compare_to_pdf_ks.
double pdf1d_compare_to_pdf::compare_form | ( | const double * | data, |
int | n, | ||
const pdf1d_builder & | builder | ||
) | [virtual] |
Test whether data has form of the given distribution.
Default behaviour is to build pdf from data and then compare data with pdf
Definition at line 64 of file pdf1d_compare_to_pdf.cxx.
vcl_string pdf1d_compare_to_pdf::is_a | ( | ) | const [virtual] |
Name of the class.
Reimplemented in pdf1d_compare_to_pdf_bhat, and pdf1d_compare_to_pdf_ks.
Definition at line 113 of file pdf1d_compare_to_pdf.cxx.
bool pdf1d_compare_to_pdf::is_class | ( | vcl_string const & | s | ) | const [virtual] |
Does the name of the class match the argument?.
Reimplemented in pdf1d_compare_to_pdf_bhat, and pdf1d_compare_to_pdf_ks.
Definition at line 122 of file pdf1d_compare_to_pdf.cxx.
virtual void pdf1d_compare_to_pdf::print_summary | ( | vcl_ostream & | os | ) | const [pure virtual] |
Print class to os.
Implemented in pdf1d_compare_to_pdf_bhat, and pdf1d_compare_to_pdf_ks.
short pdf1d_compare_to_pdf::version_no | ( | ) | const |
Version number for I/O.
Reimplemented in pdf1d_compare_to_pdf_bhat, and pdf1d_compare_to_pdf_ks.
mbl_cloneable_ptr<pdf1d_pdf> pdf1d_compare_to_pdf::pdf_ [protected] |
Workspace for PDFs.
Definition at line 28 of file pdf1d_compare_to_pdf.h.