KrisLibrary  1.0.0
LogisticModel.h
1 #ifndef STATISTICS_LOGISTIC_MODEL_H
2 #define STATISTICS_LOGISTIC_MODEL_H
3 
4 #include "statistics.h"
5 
6 namespace Statistics {
7 
15 {
16  public:
17  LogisticModel() {}
18  Real Evaluate(const Vector& x) const;
19  Real EvaluateExpectation(const Vector& x,int numSamples=20) const;
20  Real EvaluateVariance(const Vector& x,int numSamples=20) const;
21  //calculate the maximum likelihood estimate for v[i] the boolean result
22  //for datapoint x[i]
23  void MaximumLikelihood(const std::vector<Vector>& x,const std::vector<bool>& v,int numIters,Real tol);
24 
25  Vector coeffs;
26  Matrix covariance;
27 };
28 
29 std::ostream& operator << (std::ostream& out,const LogisticModel& model);
30 std::istream& operator >> (std::istream& in,LogisticModel& model);
31 
32 } //namespace Statistics
33 
34 #endif
Contains all definitions in the statistics directory.
Definition: BernoulliDistribution.h:6
Basic statistical utilities.
Models the probability of a boolean outcome using a logit.
Definition: LogisticModel.h:14