20 using namespace shogun;
21 using namespace Eigen;
23 namespace { MatrixXd cor(MatrixXd x,
int tau = 0,
bool mean_flag =
true); };
33 m_tau[0]=0; m_tau[1]=1; m_tau[2]=2; m_tau[3]=3;
70 Map<MatrixXd> EX(X.
matrix,n,m);
79 for (
int t = 0; t < N; t++)
82 EM = cor(EX,m_tau[t]);
87 Map<MatrixXd> EQ(Q.
matrix,n,n);
95 for (
int t = 0; t < C.cols(); t++)
96 C.col(t) /= C.col(t).maxCoeff();
107 MatrixXd cor(MatrixXd x,
int tau,
bool mean_flag)
115 VectorXd mean = x.rowwise().sum();
117 x = x.colwise() - mean;
121 MatrixXd L = x.leftCols(n-tau);
122 MatrixXd R = x.rightCols(n-tau);
126 K = (L * R.transpose()) / (n-tau);
129 K = (K + K.transpose()) / 2.0;
135 #endif // HAVE_EIGEN3