In file ../include/EST_simplestats.h:
class EST_DiscreteProbDistribution |
A class for representing probability distributions for a set of discrete values.
![]() | EST_DiscreteProbDistribution (const EST_DiscreteProbDistribution &b) Create with copying from an existing distribution |
![]() | EST_DiscreteProbDistribution (const EST_TList<EST_String> &vocab) Create with given vocabulary |
![]() | EST_DiscreteProbDistribution (const EST_Discrete* d) Create using given EST_Discrete class as the vocabulary |
![]() | EST_DiscreteProbDistribution (const EST_Discrete* d, const double n_samples, const EST_DVector &counts) Create using given EST_Discrete class as vocabulary plus given counts |
![]() | ~EST_DiscreteProbDistribution () Destructor function |
![]() | copy (const EST_DiscreteProbDistribution &b) Copy all data from another DPD to this |
![]() | clear (void) Reset, clearing all counts and vocabulary |
![]() | init (const EST_StrList &vocab) Initialise using given vocabulary |
![]() | init (const EST_Discrete* d) Initialise using given EST_Distcrete as vocabulary |
![]() | init () Initialise |
![]() | samples (void) const Total number of example found |
![]() | cumulate (const EST_String &s, double count=1) Add this observation, may specify number of occurences |
![]() | cumulate (const int i, double count=1) Add this observation, i must be with in EST_Discrete range |
![]() | most_probable (double* prob = NULL) const Return the most probable member of the distribution |
![]() | entropy (void) const Return the entropy of the distribution ![]() |
![]() | probability (const EST_String &s) const |
![]() | probability (const int i) const |
![]() | frequency (const EST_String &s) const |
![]() | frequency (const int i) const |
![]() | item_start () const Used for iterating through members of the distribution |
![]() | item_next (int idx) const Used for iterating through members of the distribution |
![]() | item_end (int idx) const Used for iterating through members of the distribution |
![]() | item_name (int idx) const During iteration ruturns name given index |
![]() | item_freq (int idx, EST_String &s, double &freq) const During iteration ruturns name and frequency given index |
![]() | item_prob (int idx, EST_String &s, double &prob) const During iteration ruturns name and probability given index |
![]() | get_discrete () const Returns discrete vocabilary of distribution |
![]() | set_frequency (const EST_String &s, double c) Sets the frequency of named item, modifes num_samples accordingly. |
![]() | set_frequency (int i, double c) Sets the frequency of named item, modifes num_samples accordingly. |
![]() | override_frequency (const EST_String &s, double c) Sets the frequency of named item, without modifying num_samples |
![]() | override_frequency (int i, double c) Sets the frequency of named item, without modifying num_samples |
![]() | set_num_samples (const double c) Sets the number of samples. |
A class for representing probability distributions for a set of discrete values.This may be used to cummulate the probability distribution of a class of values. Values are actually help as frequencies so both frequency and probability information may be available. Note that frequencies are not integers because usings smoothing and backoff integers are too restrictive so they are actually represented as doubles.
Methods are provided to iterate over the values in a distribution, for example
EST_DiscreteProbistribution pdf; for (int i=pdf.item_start(); i < pdf.item_end(); i=pdf.item_next(i)) { EST_String name; double prob; item_prob(i,name,prob); cout << name << ": prob " << prob << endl; }
Alphabetic index HTML hierarchy of classes or Java
This page is part of the
Edinburgh Speech Tools Library documentation
Copyright University of Edinburgh 1997
Contact:
speech_tools@cstr.ed.ac.uk