KJB
|
concrete class for contingency table cell More...
#include <Cell_traits.h>
Public Types | |
typedef Marginal_cell< T, N > | Self |
typedef boost::shared_ptr< Self > | Self_ptr |
typedef Cell_traits< T, N > | Traits |
typedef Marginal_cell_base::Self_ptr | Base_ptr |
typedef Context_cell_base::Self_ptr | Context_base_ptr |
typedef Categorical_event< N > | Key_type |
typedef boost::unordered_map < Key_type, Self_ptr > | Map |
typedef Context_cell< T, N > | Context_type |
typedef boost::shared_ptr < Context_type > | Context_ptr |
typedef Traits::Margin_type | Margin_type |
typedef boost::shared_ptr < Margin_type > | Margin_ptr |
Public Types inherited from semantics::Marginal_cell_base | |
typedef boost::shared_ptr < Marginal_cell_base > | Self_ptr |
typedef boost::shared_ptr < Context_cell_base > | Context_ptr |
typedef std::map< size_t, size_t > | Table_count_map |
Public Types inherited from semantics::Cell | |
typedef boost::shared_ptr< Cell > | Self_ptr |
typedef std::vector< size_t > | Step_sizes |
Public Member Functions | |
Marginal_cell (const Key_type &key) | |
ctor to create a new cell out of a key More... | |
Marginal_cell (const Marginal_cell &other) | |
copy ctor More... | |
virtual | ~Marginal_cell () |
destructor More... | |
const Key_type & | key () const |
return data More... | |
Base_ptr | margin () const |
get smoothed cell More... | |
Context_base_ptr | context () const |
get conditioning context More... | |
void | increment (const size_t &table_code) |
increment this cell and its relevant margins and contexts More... | |
void | decrement (const size_t &table_code) |
decrement this cell and its relevant margins and contexts More... | |
void | increment_table_count () |
increment the number of distinct tables with this value More... | |
void | decrement_table_count () |
decrement the number of distinct tables with this value More... | |
size_t | sample_table_assignment () |
stochastically return a new table assignment for an observation More... | |
double | backoff_probability () const |
prob of this outcome conditioned on starting a new table More... | |
double | predictive_probability () const |
predictive probability of this outcome in this context More... | |
double | smoothed_probability () |
predictive probability under original Collins algorithm More... | |
Public Member Functions inherited from semantics::Cell | |
const size_t & | count () const |
get current count in this cell More... | |
const size_t & | table_count () const |
get number of "tables" in this cell More... | |
virtual void | increment () |
increment count More... | |
virtual void | decrement () |
decrement count More... | |
Static Public Member Functions | |
static Self_ptr | add_event (const Key_type &key, Cell::Step_sizes::const_reverse_iterator first, const size_t &size, const size_t &out_size) |
creates a new instance and sets its margin and context More... | |
static Context_ptr | add_context_event (const typename Context_type::Key_type &key) |
creates a new context cell and returns a pointer to it More... | |
Static Public Attributes | |
static Map | map |
static bool & | VERBOSE = Cell::VERBOSE |
Static Public Attributes inherited from semantics::Cell | |
static bool | VERBOSE = false |
Friends | |
std::ostream & | operator (std::ostream &os, const Map &map) |
output a contingency table in human readable form to an ostream More... | |
Additional Inherited Members | |
Protected Member Functions inherited from semantics::Marginal_cell_base | |
Marginal_cell_base () | |
constructor More... | |
Protected Member Functions inherited from semantics::Cell | |
Cell () | |
default ctor More... | |
virtual | ~Cell () |
virtual destructor More... | |
Protected Attributes inherited from semantics::Marginal_cell_base | |
Table_count_map | per_table_counts_ |
Protected Attributes inherited from semantics::Cell | |
size_t | count_ |
size_t | table_count_ |
concrete class for contingency table cell
typedef Marginal_cell_base::Self_ptr semantics::Marginal_cell< T, N >::Base_ptr |
typedef Context_cell_base::Self_ptr semantics::Marginal_cell< T, N >::Context_base_ptr |
typedef boost::shared_ptr<Context_type> semantics::Marginal_cell< T, N >::Context_ptr |
typedef Context_cell<T,N> semantics::Marginal_cell< T, N >::Context_type |
typedef Categorical_event<N> semantics::Marginal_cell< T, N >::Key_type |
typedef boost::unordered_map<Key_type, Self_ptr> semantics::Marginal_cell< T, N >::Map |
typedef boost::shared_ptr<Margin_type> semantics::Marginal_cell< T, N >::Margin_ptr |
typedef Traits::Margin_type semantics::Marginal_cell< T, N >::Margin_type |
typedef Marginal_cell<T,N> semantics::Marginal_cell< T, N >::Self |
typedef boost::shared_ptr<Self> semantics::Marginal_cell< T, N >::Self_ptr |
typedef Cell_traits<T,N> semantics::Marginal_cell< T, N >::Traits |
semantics::Marginal_cell< T, N >::Marginal_cell | ( | const Key_type & | key | ) |
ctor to create a new cell out of a key
key | container holding values of each categorical variable |
semantics::Marginal_cell< T, N >::Marginal_cell | ( | const Marginal_cell< T, N > & | other | ) |
copy ctor
|
virtual |
destructor
|
static |
creates a new context cell and returns a pointer to it
|
static |
creates a new instance and sets its margin and context
|
inlinevirtual |
prob of this outcome conditioned on starting a new table
corresponds to q(x,H) in the writeup
Implements semantics::Marginal_cell_base.
|
inlinevirtual |
get conditioning context
Implements semantics::Marginal_cell_base.
|
virtual |
decrement this cell and its relevant margins and contexts
Implements semantics::Marginal_cell_base.
|
virtual |
decrement the number of distinct tables with this value
Reimplemented from semantics::Cell.
|
virtual |
increment this cell and its relevant margins and contexts
Implements semantics::Marginal_cell_base.
|
virtual |
increment the number of distinct tables with this value
Reimplemented from semantics::Cell.
|
inlinevirtual |
return data
Implements semantics::Cell.
|
inlinevirtual |
get smoothed cell
Implements semantics::Marginal_cell_base.
|
inlinevirtual |
predictive probability of this outcome in this context
corresponds to p(x|beta(H)) in the writeup, but is not normalized. normalization must occur later when comparing
Implements semantics::Marginal_cell_base.
|
inlinevirtual |
stochastically return a new table assignment for an observation
Uses the Hierarchical CRP mechanism to sample a new table assignment. Includes bookkeeping to recycle table indices
Implements semantics::Marginal_cell_base.
|
inlinevirtual |
predictive probability under original Collins algorithm
Implements semantics::Marginal_cell_base.
|
friend |
output a contingency table in human readable form to an ostream
|
static |
|
static |