#include <Distribution.h>
Inheritance diagram for PLearn::Distribution:
Public Types | |
typedef Learner | inherited |
Public Member Functions | |
Distribution () | |
virtual void | build () |
**** SUBCLASS WRITING: **** This method should be redefined in subclasses, to just call inherited::build() and then build_() | |
virtual void | makeDeepCopyFromShallowCopy (map< const void *, void * > &copies) |
Transforms a shallow copy into a deep copy. | |
PLEARN_DECLARE_OBJECT (Distribution) | |
Declares name and deepCopy methods. | |
virtual void | train (VMat training_set) |
trains the model | |
virtual void | use (const Vec &input, Vec &output) |
computes the ouptu of a trained model | |
virtual double | log_density (const Vec &x) const |
return log of probability density log(p(x)) | |
virtual double | density (const Vec &x) const |
return probability density p(x) [ default version returns exp(log_density(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 pseudo-random sample generated from the distribution. | |
Public Attributes | |
string | use_returns_what |
A string where the characters have the following meaning: 'l'->log_density, 'd' -> density, 'c' -> cdf, 's' -> survival_fn, 'e' -> expectation, 'v' -> variance. | |
Static Protected Member Functions | |
void | declareOptions (OptionList &ol) |
Declares this class' options. | |
Private Member Functions | |
void | build_ () |
This does the actual building. |
|
Reimplemented from PLearn::Learner. Reimplemented in PLearn::ConditionalDistribution, PLearn::ConditionalGaussianDistribution, PLearn::EmpiricalDistribution, and PLearn::LocallyWeightedDistribution. Definition at line 64 of file Distribution.h. |
|
Definition at line 50 of file Distribution.cc. References PLearn::neg_output_costfunc(). |
|
**** SUBCLASS WRITING: **** This method should be redefined in subclasses, to just call inherited::build() and then build_()
Reimplemented from PLearn::Learner. Reimplemented in PLearn::ConditionalGaussianDistribution, and PLearn::LocallyWeightedDistribution. Definition at line 91 of file Distribution.cc. References build_(). |
|
This does the actual building.
Reimplemented from PLearn::Learner. Reimplemented in PLearn::LocallyWeightedDistribution. Definition at line 77 of file Distribution.cc. References use_returns_what. Referenced by build(). |
|
return survival fn = P(X<x)
Reimplemented in PLearn::ConditionalGaussianDistribution, and PLearn::EmpiricalDistribution. Definition at line 154 of file Distribution.cc. References PLERROR. Referenced by use(). |
|
Declares this class' options.
Reimplemented from PLearn::Learner. Reimplemented in PLearn::ConditionalGaussianDistribution, PLearn::EmpiricalDistribution, and PLearn::LocallyWeightedDistribution. Definition at line 61 of file Distribution.cc. References PLearn::declareOption(), and PLearn::OptionList. |
|
return probability density p(x) [ default version returns exp(log_density(x)) ]
Reimplemented in PLearn::ConditionalGaussianDistribution. Definition at line 148 of file Distribution.cc. References PLearn::exp(), log_density(), and x. Referenced by use(). |
|
return E[X]
Reimplemented in PLearn::ConditionalGaussianDistribution, and PLearn::EmpiricalDistribution. Definition at line 157 of file Distribution.cc. References PLERROR, and PLearn::Vec. Referenced by PLearn::ConditionalDistribution::use(). |
|
return a pseudo-random sample generated from the distribution.
Reimplemented in PLearn::ConditionalGaussianDistribution, and PLearn::EmpiricalDistribution. Definition at line 163 of file Distribution.cc. References PLERROR. |
|
return log of probability density log(p(x))
Reimplemented in PLearn::ConditionalGaussianDistribution, PLearn::EmpiricalDistribution, and PLearn::LocallyWeightedDistribution. Definition at line 145 of file Distribution.cc. References PLERROR. |
|
Transforms a shallow copy into a deep copy.
Reimplemented in PLearn::ConditionalDistribution, PLearn::ConditionalGaussianDistribution, and PLearn::LocallyWeightedDistribution. Definition at line 140 of file Distribution.cc. |
|
Declares name and deepCopy methods.
|
|
return survival fn = P(X>x)
Reimplemented in PLearn::ConditionalGaussianDistribution, and PLearn::EmpiricalDistribution. Definition at line 151 of file Distribution.cc. References PLERROR. Referenced by use(). |
|
trains the model
Implements PLearn::Learner. Reimplemented in PLearn::ConditionalGaussianDistribution, PLearn::EmpiricalDistribution, and PLearn::LocallyWeightedDistribution. Definition at line 98 of file Distribution.cc. References PLearn::Learner::inputsize(), PLERROR, PLearn::Learner::targetsize(), and PLearn::VMat::width(). |
|
computes the ouptu of a trained model
Implements PLearn::Learner. Reimplemented in PLearn::ConditionalDistribution. Definition at line 115 of file Distribution.cc. References cdf(), density(), log_density(), PLERROR, survival_fn(), use_returns_what, and PLearn::Vec. |
|
return Var[X]
Reimplemented in PLearn::ConditionalGaussianDistribution, and PLearn::EmpiricalDistribution. Definition at line 160 of file Distribution.cc. References PLearn::Mat, and PLERROR. Referenced by PLearn::ConditionalDistribution::use(). |
|
A string where the characters have the following meaning: 'l'->log_density, 'd' -> density, 'c' -> cdf, 's' -> survival_fn, 'e' -> expectation, 'v' -> variance.
Definition at line 72 of file Distribution.h. |