libDAI
Public Member Functions | Static Public Member Functions | Private Attributes | Static Private Attributes | List of all members
dai::CondProbEstimation Class Reference

Estimates the parameters of a conditional probability table, using pseudocounts. More...

#include <dai/emalg.h>

Inheritance diagram for dai::CondProbEstimation:
dai::ParameterEstimation

Public Member Functions

 CondProbEstimation (size_t target_dimension, const Prob &pseudocounts)
 Constructor. More...
 
virtual ParameterEstimationclone () const
 Virtual copy constructor. More...
 
virtual ~CondProbEstimation ()
 Virtual destructor. More...
 
virtual Prob parameters (const Prob &p)
 Returns an estimate of the conditional probability distribution. More...
 
virtual Prob parametersToFactor (const Prob &p)
 Convert a set of estimated parameters to a factor. More...
 
virtual size_t probSize () const
 Returns the required size for arguments to estimate(). More...
 
virtual const std::string & name () const
 
virtual const PropertySetproperties () const
 

Static Public Member Functions

static ParameterEstimationfactory (const PropertySet &p)
 Virtual constructor, using a PropertySet. More...
 

Private Attributes

size_t _target_dim
 Number of states of the variable of interest. More...
 
Prob _initial_stats
 Initial pseudocounts. More...
 
PropertySet _props
 PropertySet that allows reconstruction of this estimator. More...
 

Static Private Attributes

static std::string _name = "CondProbEstimation"
 

Additional Inherited Members

- Private Types inherited from dai::ParameterEstimation
typedef ParameterEstimation *(* ParamEstFactory) (const PropertySet &)
 Type of pointer to factory function. More...
 
- Private Member Functions inherited from dai::ParameterEstimation
virtual ~ParameterEstimation ()
 Virtual destructor for deleting pointers to derived classes. More...
 
virtual Prob estimate (const Prob &p)
 Estimate the factor using the provided expectations. More...
 
- Static Private Member Functions inherited from dai::ParameterEstimation
static ParameterEstimationconstruct (const std::string &method, const PropertySet &p)
 General factory method that constructs the desired ParameterEstimation subclass. More...
 
static void registerMethod (const std::string &method, const ParamEstFactory &f)
 Register a subclass so that it can be used with construct(). More...
 

Detailed Description

Estimates the parameters of a conditional probability table, using pseudocounts.

Author
Charles Vaske

Constructor & Destructor Documentation

dai::CondProbEstimation::CondProbEstimation ( size_t  target_dimension,
const Prob pseudocounts 
)

Constructor.

For a conditional probability $ P( X | Y ) $,

Parameters
target_dimensionshould equal $ | X | $
pseudocountsare the initial pseudocounts, of length $ |X| \cdot |Y| $
virtual dai::CondProbEstimation::~CondProbEstimation ( )
inlinevirtual

Virtual destructor.

Member Function Documentation

ParameterEstimation * dai::CondProbEstimation::factory ( const PropertySet p)
static

Virtual constructor, using a PropertySet.

Some keys in the PropertySet are required. For a conditional probability $ P( X | Y ) $,

  • target_dimension should be equal to $ | X | $
  • total_dimension should be equal to $ |X| \cdot |Y| $

An optional key is:

  • pseudo_count which specifies the initial counts (defaults to 1)
virtual ParameterEstimation* dai::CondProbEstimation::clone ( ) const
inlinevirtual

Virtual copy constructor.

Implements dai::ParameterEstimation.

Prob dai::CondProbEstimation::parameters ( const Prob p)
virtual

Returns an estimate of the conditional probability distribution.

The format of the resulting Prob keeps all the values for $ P(X | Y=y) $ in sequential order in the array.

Implements dai::ParameterEstimation.

Prob dai::CondProbEstimation::parametersToFactor ( const Prob params)
virtual

Convert a set of estimated parameters to a factor.

Implements dai::ParameterEstimation.

virtual size_t dai::CondProbEstimation::probSize ( ) const
inlinevirtual

Returns the required size for arguments to estimate().

Implements dai::ParameterEstimation.

Member Data Documentation

size_t dai::CondProbEstimation::_target_dim
private

Number of states of the variable of interest.

Prob dai::CondProbEstimation::_initial_stats
private

Initial pseudocounts.

PropertySet dai::CondProbEstimation::_props
private

PropertySet that allows reconstruction of this estimator.


The documentation for this class was generated from the following files: