00001 #if !defined (TIME_SERIES_H) 00002 #define TIME_SERIES_H 00003 00004 #include "distributed_data.h" 00005 #include "random_number.h" 00006 00007 //OPT ++ headers 00008 #include "OPT++_config.h" 00009 #include "NLF.h" 00010 //#include "Constraint.h" 00011 #include "BoundConstraint.h" 00012 #include "LinearInequality.h" 00013 #include "OptFDNIPS.h" 00014 using NEWMAT::ColumnVector; 00015 using NEWMAT::Matrix; 00016 using NEWMAT::SymmetricMatrix; 00017 00018 00019 /************************************************************/ 00020 00021 void garch_init(int ndim, ColumnVector &X); 00022 00023 00024 void garch(int ndim, const ColumnVector &x, OPTPP::real &fx, 00025 int &result, void* ptr); 00026 /************************************************************/ 00036 class TimeSeries { 00037 private: 00038 double time_start; 00039 double shock_start; 00040 const int num_samples; 00041 const int max_lag; 00042 00043 00044 00045 public: 00046 RandomNumber shocks; 00047 //RandomNumber volatility; 00048 00049 //Constructors 00050 TimeSeries(int num_samples,int max_lag); 00051 00052 00053 void print(string file_name); 00054 void set_init_shock(double s){shock_start=s;} 00055 double init_shock(void){return shock_start;} 00056 00057 00058 void get_garch_param(); 00059 //void get_garch_forecast(); 00060 // void print_acf(int max_lag, string file_name); 00061 // void get_lag(int lag,RandomNumber &rn); 00062 00063 }; 00064 #endif