Functions
contrib/mul/pdf1d/tools/compare_kernel_estimates.cxx File Reference

Program to test different kernel approximations. More...

#include <vcl_iostream.h>
#include <mbl/mbl_stats_1d.h>
#include <vnl/vnl_vector.h>
#include <pdf1d/pdf1d_compare_to_pdf_bhat.h>
#include <pdf1d/pdf1d_compare_to_pdf_ks.h>
#include <pdf1d/pdf1d_sampler.h>
#include <pdf1d/pdf1d_exponential.h>
#include <pdf1d/pdf1d_gaussian_kernel_pdf_builder.h>

Go to the source code of this file.

Functions

void test_comparison (vcl_vector< mbl_stats_1d > &B_stats, const vnl_vector< double > &x, const pdf1d_pdf &true_pdf, vcl_vector< pdf1d_compare_to_pdf * > comparator)
 Compute how well data in x matches true pdf using n different comparators.
void test_comparison (vcl_vector< mbl_stats_1d > &B_stats, int n_samples, int n_repeats, const pdf1d_pdf &true_pdf, vcl_vector< pdf1d_compare_to_pdf * > comparator)
 Compute how well data sampled from true_pdf matches true_pdf using n different comparators.
void test_comparison (int n_samples, int n_trials, const pdf1d_pdf &true_pdf, vcl_vector< pdf1d_compare_to_pdf * > comparator, const vcl_vector< vcl_string > &name)
int main ()

Detailed Description

Program to test different kernel approximations.

Author:
Tim Cootes

We generate N samples from a known distribution e.g. unit Gaussian, flat or exponential. We then use a variety of kernel estimation techniques (e.g. fixed width, adaptive kernels etc) to generate a kernel pdf from the samples. We then estimate the Bhat. overlap with the true pdf.

Definition in file compare_kernel_estimates.cxx.


Function Documentation

int main ( )

Definition at line 79 of file compare_kernel_estimates.cxx.

void test_comparison ( vcl_vector< mbl_stats_1d > &  B_stats,
const vnl_vector< double > &  x,
const pdf1d_pdf true_pdf,
vcl_vector< pdf1d_compare_to_pdf * >  comparator 
)

Compute how well data in x matches true pdf using n different comparators.

Definition at line 25 of file compare_kernel_estimates.cxx.

void test_comparison ( vcl_vector< mbl_stats_1d > &  B_stats,
int  n_samples,
int  n_repeats,
const pdf1d_pdf true_pdf,
vcl_vector< pdf1d_compare_to_pdf * >  comparator 
)

Compute how well data sampled from true_pdf matches true_pdf using n different comparators.

Definition at line 41 of file compare_kernel_estimates.cxx.

void test_comparison ( int  n_samples,
int  n_trials,
const pdf1d_pdf true_pdf,
vcl_vector< pdf1d_compare_to_pdf * >  comparator,
const vcl_vector< vcl_string > &  name 
)

Definition at line 58 of file compare_kernel_estimates.cxx.