Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

PLearn::EmpiricalDistribution Class Reference

#include <EmpiricalDistribution.h>

Inheritance diagram for PLearn::EmpiricalDistribution:

Inheritance graph
[legend]
Collaboration diagram for PLearn::EmpiricalDistribution:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 EmpiricalDistribution ()
 EmpiricalDistribution (int inputsize, bool random_sample_=true)
 PLEARN_DECLARE_OBJECT (EmpiricalDistribution)
void makeDeepCopyFromShallowCopy (CopiesMap &copies)
virtual void train (VMat training_set)
 trains the model

virtual double log_density (const Vec &x) const
 return log of probability density log(p(x))

virtual double survival_fn (const Vec &x) const
 return survival fn = P(X>x)

virtual double cdf (const Vec &x) const
 return survival fn = P(X<x)

virtual Vec expectation () const
 return E[X]

virtual Mat variance () const
 return Var[X]

virtual void generate (Vec &x) const
 return a sample generated from the distribution.


Public Attributes

bool random_sample
int length
int current_sample_x
int current_sample_y
bool flip

Protected Types

typedef Distribution inherited

Static Protected Member Functions

void declareOptions (OptionList &ol)
 Declares this class' options.


Protected Attributes

VMat data

Member Typedef Documentation

typedef Distribution PLearn::EmpiricalDistribution::inherited [protected]
 

Reimplemented from PLearn::Distribution.

Definition at line 48 of file EmpiricalDistribution.h.

Referenced by EmpiricalDistribution().


Constructor & Destructor Documentation

PLearn::EmpiricalDistribution::EmpiricalDistribution  ) 
 

Definition at line 54 of file EmpiricalDistribution.cc.

References inherited, and PLearn::seed().

PLearn::EmpiricalDistribution::EmpiricalDistribution int  inputsize,
bool  random_sample_ = true
 

Definition at line 61 of file EmpiricalDistribution.cc.

References current_sample_x, current_sample_y, flip, and PLearn::seed().


Member Function Documentation

double PLearn::EmpiricalDistribution::cdf const Vec x  )  const [virtual]
 

return survival fn = P(X<x)

Reimplemented from PLearn::Distribution.

Definition at line 111 of file EmpiricalDistribution.cc.

References data, PLearn::VMat::length(), PLearn::VMat::width(), and x.

void PLearn::EmpiricalDistribution::declareOptions OptionList ol  )  [static, protected]
 

Declares this class' options.

Reimplemented from PLearn::Distribution.

Definition at line 73 of file EmpiricalDistribution.cc.

References PLearn::OptionList.

Vec PLearn::EmpiricalDistribution::expectation  )  const [virtual]
 

return E[X]

Reimplemented from PLearn::Distribution.

Definition at line 128 of file EmpiricalDistribution.cc.

References PLearn::computeMean(), data, and PLearn::mean().

void PLearn::EmpiricalDistribution::generate Vec x  )  const [virtual]
 

return a sample generated from the distribution.

Reimplemented from PLearn::Distribution.

Definition at line 145 of file EmpiricalDistribution.cc.

References current_sample_x, current_sample_y, data, flip, length, random_sample, PLearn::uniform_multinomial_sample(), PLearn::VMat::width(), and x.

double PLearn::EmpiricalDistribution::log_density const Vec x  )  const [virtual]
 

return log of probability density log(p(x))

Reimplemented from PLearn::Distribution.

Definition at line 88 of file EmpiricalDistribution.cc.

References PLERROR, and PLearn::Vec.

void PLearn::EmpiricalDistribution::makeDeepCopyFromShallowCopy CopiesMap copies  )  [virtual]
 

Does the necessary operations to transform a shallow copy (this) into a deep copy by deep-copying all the members that need to be. Typical implementation:

void CLASS_OF_THIS::makeDeepCopyFromShallowCopy(CopiesMap& copies) { SUPERCLASS_OF_THIS::makeDeepCopyFromShallowCopy(copies); member_ptr = member_ptr->deepCopy(copies); member_smartptr = member_smartptr->deepCopy(copies); member_mat.makeDeepCopyFromShallowCopy(copies); member_vec.makeDeepCopyFromShallowCopy(copies); ... }

Reimplemented from PLearn::Learner.

Definition at line 47 of file EmpiricalDistribution.cc.

References PLearn::CopiesMap, data, and PLearn::deepCopyField().

PLearn::EmpiricalDistribution::PLEARN_DECLARE_OBJECT EmpiricalDistribution   ) 
 

double PLearn::EmpiricalDistribution::survival_fn const Vec x  )  const [virtual]
 

return survival fn = P(X>x)

Reimplemented from PLearn::Distribution.

Definition at line 95 of file EmpiricalDistribution.cc.

References data, PLearn::VMat::length(), PLearn::VMat::width(), and x.

void PLearn::EmpiricalDistribution::train VMat  training_set  )  [virtual]
 

trains the model

Reimplemented from PLearn::Distribution.

Definition at line 79 of file EmpiricalDistribution.cc.

References data, PLearn::VMat::length(), length, PLERROR, PLearn::VMat::subMatColumns(), and PLearn::VMat::width().

Mat PLearn::EmpiricalDistribution::variance  )  const [virtual]
 

return Var[X]

Reimplemented from PLearn::Distribution.

Definition at line 135 of file EmpiricalDistribution.cc.

References PLearn::computeMeanAndCovar(), data, PLearn::Mat, and PLearn::mean().


Member Data Documentation

int PLearn::EmpiricalDistribution::current_sample_x [mutable]
 

Definition at line 92 of file EmpiricalDistribution.h.

Referenced by EmpiricalDistribution(), and generate().

int PLearn::EmpiricalDistribution::current_sample_y [mutable]
 

Definition at line 93 of file EmpiricalDistribution.h.

Referenced by EmpiricalDistribution(), and generate().

VMat PLearn::EmpiricalDistribution::data [protected]
 

Definition at line 46 of file EmpiricalDistribution.h.

Referenced by cdf(), expectation(), generate(), makeDeepCopyFromShallowCopy(), survival_fn(), train(), and variance().

bool PLearn::EmpiricalDistribution::flip [mutable]
 

Definition at line 94 of file EmpiricalDistribution.h.

Referenced by EmpiricalDistribution(), and generate().

int PLearn::EmpiricalDistribution::length
 

Definition at line 89 of file EmpiricalDistribution.h.

Referenced by generate(), and train().

bool PLearn::EmpiricalDistribution::random_sample
 

Definition at line 86 of file EmpiricalDistribution.h.

Referenced by generate().


The documentation for this class was generated from the following files:
Generated on Tue Aug 17 16:27:13 2004 for PLearn by doxygen 1.3.7