-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVECM.h
executable file
·75 lines (53 loc) · 2.05 KB
/
VECM.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#include <armadillo>
// @TODO DOCUMENTATION of the process - The documentation of this class and the related VECM.cpp file is deferred to a later stage, after all necessary details are implemented.
// For the current state of this class, please refer to the VEC.cpp file documentation
// This class is an implmentation of the URCA R package cajo.R file, with a plan to further implement FGLS - Feasible Generalized Least Square estimation instead of the current OLS method.
// Member variables naming follows the cajo.R file in general.
class VECM {
public:
VECM();
VECM(arma::mat observation);
~VECM();
arma::mat loadCSV(const std::string& filename);
void saveMatCSV(arma::mat Mat, std::string filename);
void saveMatCSV(arma::cx_mat Mat, std::string filename);
void compute(int nlags);
arma::mat getTest(arma::mat stats);
arma::vec getEigenValues();
arma::mat getEigenVecMatrix();
arma::mat getVECModel();
arma::mat getVorg();
arma::mat getObservation();
private:
//void preprocess();
arma::mat computeCovarianceMatrix();
arma::mat computeLagMatrix();
arma::mat computeBeta();
arma::mat computeVARPara();
arma::mat computeGamma();
arma::mat getMatrixDiff();
arma::mat demean(arma::mat X);
void getEigenInput();
void getEigenOutput();
arma::mat getStatistics();
private:
unsigned int _lag;
arma::mat _observation;
arma::mat _test_stat;
arma::mat _VARPara;
arma::mat _Gamma;
arma::mat _Pi;
arma::mat _C;
arma::mat _eigenInput;
arma::cx_mat _eigvec;
arma::cx_vec _eigval;
arma::mat _Vorg;
arma::mat _covariance;
arma::mat _beta;
arma::mat _lag_matrix;
arma::mat _d_lag_matrix;
arma::mat _Z0;
arma::mat _Z1;
arma::mat _ZK;
static arma::mat crit_eigen;
};