16 std::cout <<
"Data file name: ";
22 const size_t nchan = 4;
23 gplib::rmat input(nchan, nobs);
24 gplib::cmat evec(nchan, nchan);
25 gplib::cvec eval(nchan);
27 for (
unsigned int i = 0; i < nobs; ++i)
35 PCA(input, evec, eval);
37 gplib::cmat wmat(
WhiteMat(evec, eval));
38 std::cout <<
"pca evec: " << evec << std::endl;
39 std::cout <<
"pca eval: " << eval << std::endl;
40 std::cout <<
"pca WhM: " << wmat << std::endl;
41 std::cout <<
"pca DeWhM: " <<
DeWhiteMat(evec, eval) << std::endl;
43 gplib::cmat output(nchan, nobs);
44 noalias(output) = prec_prod(wmat, input);
45 for (
unsigned int i = 0; i < nobs; ++i)
gplib::cmat WhiteMat(gplib::cmat &evectors, gplib::cvec &evalues)
Calculate the Whitening Matrix.
std::vector< double > & GetData()
Access for data vector, for ease of use and efficiency we return a reference.
TimeSeries & GetData()
return a reference to the actual object stored in the pointer
TimeSeriesComponent & GetEx()
void PCA(const UblasMatrix &observations, gplib::cmat &evectors, gplib::cvec &evalues)
This template function calculates the principal component rotation matrix from a matrix of observatio...
TimeSeriesComponent & GetHy()
gplib::cmat DeWhiteMat(gplib::cmat &evectors, gplib::cvec &evalues)
Calculate the Dewhitening Matrix.
void WriteAsBirrp(std::string filename_base)
Write data to file in ascii format for birrp processing.
TimeSeriesData stores a pointer to the different components of magnetotelluric data and provides func...
size_t Size()
Return the size of the time series, throws if one of the components has a different size...
TimeSeriesComponent & GetEy()
TimeSeriesComponent & GetHx()
Access function for Hx, returns reference for efficiency.