00001 #ifndef MMR_H_ 00002 #define MMR_H_ 00003 00004 #include <Matrix.h> 00005 #include <vector> 00006 #include <cmath> 00007 00008 using namespace std; 00009 00011 class MMR 00012 { 00013 00014 public: 00015 00017 static const double EPSILON = 1e-12; 00018 00025 MMR(double ** independent=0, double ** dependent=0, int numIndependent=0, int numDependent=0, int numRows=0); 00026 00028 virtual ~MMR(); 00029 00033 void LoadData(Matrix<double> *independent, Matrix<double> *dependent); 00034 00041 void LoadData(double ** independent, double ** dependent, int numIndependent, int numDependent, int numRows); 00042 00045 void PerformRegression(bool constantIsZero = false); 00046 00049 void GetBeta(Matrix<double> *beta); 00050 00053 void GetResiduals(Matrix<double> *residuals); 00054 00057 void GetPredictions(Matrix<double> *predictions); 00058 00061 void GetRegressionStatistics(string *statistics); 00062 00065 bool IsCalculated(); 00066 00069 void PrintReport(bool constantIsZero); 00070 00071 00072 private: 00073 00074 bool m_calculated; 00075 int m_numIndependent; 00076 int m_numDependent; 00077 int m_rows; 00078 bool m_constantIsZero; 00079 double m_degreesOfFreedom; 00080 Matrix<double> m_independent; 00081 Matrix<double> m_dependent; 00082 Matrix<double> m_beta; 00083 Matrix<double> m_rss; 00084 Matrix<double> m_tss; 00085 Matrix<double> m_ess; 00086 Matrix<double> m_rms; 00087 Matrix<double> m_rsqr; 00088 Matrix<double> m_adjRsqr; 00089 Matrix<double> m_standardErrorB; 00090 Matrix<double> m_standardErrorY; 00091 Matrix<double> m_tStatB; 00092 Matrix<double> m_tProbB; 00093 Matrix<double> m_FStat; 00094 Matrix<double> m_FProb; 00095 Matrix<double> m_WilksLambdaMatrix; 00096 double m_FTestWilks; 00097 double m_FProbWilks; 00098 double m_WilksLambda; 00099 double m_PillaisTrace; 00100 double m_HotellingLawleyTrace; 00101 double m_RoysLargestRoot; 00102 Matrix<double> m_y; 00103 Matrix<double> m_x; 00104 string m_statistics; 00105 }; 00106 00107 00108 #endif