Functions | Variables
contrib/mul/pdf1d/tools/select_n_mixtures.cxx File Reference

Program to explore selecting optimal number of mixture components. More...

#include <vcl_iostream.h>
#include <vnl/vnl_vector.h>
#include <pdf1d/pdf1d_compare_to_pdf_bhat.h>
#include <pdf1d/pdf1d_sampler.h>
#include <pdf1d/pdf1d_mixture_builder.h>
#include <pdf1d/pdf1d_gaussian_builder.h>
#include <pdf1d/pdf1d_gaussian_kernel_pdf.h>
#include <pdf1d/pdf1d_gaussian_kernel_pdf_builder.h>

Go to the source code of this file.

Functions

void test_form (vcl_vector< double > &B, const vnl_vector< double > &x, vcl_vector< pdf1d_builder * > &builder, pdf1d_compare_to_pdf_bhat &comparator)
 Compute how well different forms of pdf match to data x.
void select_form (vnl_vector< int > &histo, int n_samples, int n_trials, const pdf1d_pdf &true_pdf, vcl_vector< pdf1d_builder * > &builder, pdf1d_compare_to_pdf_bhat &comparator)
void select_form (int n_samples, int n_trials, int max_comp, const pdf1d_pdf &true_pdf, pdf1d_compare_to_pdf_bhat &comparator)
int main ()

Variables

vcl_ofstream ofs

Detailed Description

Program to explore selecting optimal number of mixture components.

Author:
Tim Cootes

We generate N samples from a known mixture model. We then try to fit mixture models with different numbers of components to the data, and select the one that gives the largest mean overlap.

Definition in file select_n_mixtures.cxx.


Function Documentation

int main ( )

Definition at line 117 of file select_n_mixtures.cxx.

void select_form ( vnl_vector< int > &  histo,
int  n_samples,
int  n_trials,
const pdf1d_pdf true_pdf,
vcl_vector< pdf1d_builder * > &  builder,
pdf1d_compare_to_pdf_bhat comparator 
)

Definition at line 47 of file select_n_mixtures.cxx.

void select_form ( int  n_samples,
int  n_trials,
int  max_comp,
const pdf1d_pdf true_pdf,
pdf1d_compare_to_pdf_bhat comparator 
)

Definition at line 85 of file select_n_mixtures.cxx.

void test_form ( vcl_vector< double > &  B,
const vnl_vector< double > &  x,
vcl_vector< pdf1d_builder * > &  builder,
pdf1d_compare_to_pdf_bhat comparator 
)

Compute how well different forms of pdf match to data x.

pdf[i] is the model built by builder[i]

Definition at line 26 of file select_n_mixtures.cxx.


Variable Documentation

vcl_ofstream ofs

Definition at line 22 of file select_n_mixtures.cxx.