Skip to content
Snippets Groups Projects
Commit 2ebc3060 authored by Christian Beckmann's avatar Christian Beckmann
Browse files

fixed GLM OLS bug

parent 09112c50
No related branches found
No related tags found
No related merge requests found
...@@ -138,18 +138,24 @@ namespace Melodic{ ...@@ -138,18 +138,24 @@ namespace Melodic{
void MelodicData::set_TSmode() void MelodicData::set_TSmode()
{ {
dbgmsg(string("START: set_TSmode"));
Matrix tmp, tmpT, tmpS, tmpT2, tmpS2, tmpT3; Matrix tmp, tmpT, tmpS, tmpT2, tmpS2, tmpT3;
tmp = expand_dimred(mixMatrix); tmp = expand_dimred(mixMatrix);
tmpT = zeros(tmp.Nrows()/numfiles, tmp.Ncols()); tmpT = zeros(tmp.Nrows()/numfiles, tmp.Ncols());
tmpS = zeros(numfiles, tmp.Ncols()); tmpS = zeros(numfiles, tmp.Ncols());
if(opts.approach.value()==string("tica")){ outMsize("tmp",tmp);
outMsize("tmpT",tmpT);
outMsize("tmpS",tmpS);
dbgmsg(string(" approach ") << opts.approach.value() << endl);
if(!opts.approach.value()==string("concat")){
message("Calculating T- and S-modes " << endl);
explained_var = krfact(tmp,tmpT,tmpS); explained_var = krfact(tmp,tmpT,tmpS);
outMsize("tmp",tmp); if(opts.approach.value()==string("tica")){
outMsize("tmpT",tmpT);
outMsize("tmpS",tmpS);
if(opts.approach.value()==string("tica")){
Tmodes.clear(); Smodes.clear(); Tmodes.clear(); Smodes.clear();
for(int ctr = 1; ctr <= tmp.Ncols(); ctr++){ for(int ctr = 1; ctr <= tmp.Ncols(); ctr++){
tmpT3 << reshape(tmp.Column(ctr),tmpT.Nrows(),numfiles); tmpT3 << reshape(tmp.Column(ctr),tmpT.Nrows(),numfiles);
...@@ -165,7 +171,6 @@ namespace Melodic{ ...@@ -165,7 +171,6 @@ namespace Melodic{
} }
add_Tmodes(tmpT2); add_Tmodes(tmpT2);
add_Smodes(tmpS2); add_Smodes(tmpS2);
}
} }
//add GLM OLS fit //add GLM OLS fit
...@@ -185,9 +190,9 @@ namespace Melodic{ ...@@ -185,9 +190,9 @@ namespace Melodic{
} }
} }
// else{ else{
// add_Tmodes(tmp); add_Tmodes(tmp);
// } }
dbgmsg(string("END: set_TSmode")); dbgmsg(string("END: set_TSmode"));
......
...@@ -476,7 +476,7 @@ namespace Melodic { ...@@ -476,7 +476,7 @@ namespace Melodic {
melodat.set_ICstats(scales); melodat.set_ICstats(scales);
melodat.sort(); melodat.sort();
message("Calculating T- and S-modes " << endl); //message("Calculating T- and S-modes " << endl);
melodat.set_TSmode(); melodat.set_TSmode();
} }
......
...@@ -34,6 +34,12 @@ using namespace std; ...@@ -34,6 +34,12 @@ using namespace std;
Option<int> help(string("-h,--help"), 0, Option<int> help(string("-h,--help"), 0,
string("display this help text"), string("display this help text"),
false,no_argument); false,no_argument);
Option<int> xdim(string("-x,--xdim"), 10,
string("xdim"),
false,requires_argument);
Option<int> ydim(string("-y,--ydim"), 10,
string("ydim"),
false,requires_argument);
/* /*
} }
*/ */
...@@ -42,7 +48,12 @@ using namespace std; ...@@ -42,7 +48,12 @@ using namespace std;
// Local functions // Local functions
int do_work(int argc, char* argv[]) { int do_work(int argc, char* argv[]) {
Matrix test;
cerr << " X: "<< xdim.value() << ", Y: "<< ydim.value() << endl;
test = zeros(xdim.value(),ydim.value());
cerr << "Created matrix of size " << test.Nrows() << " x " << test.Ncols() << endl;
return 0; return 0;
} }
...@@ -55,17 +66,10 @@ int do_work(int argc, char* argv[]) { ...@@ -55,17 +66,10 @@ int do_work(int argc, char* argv[]) {
// must include all wanted options here (the order determines how // must include all wanted options here (the order determines how
// the help message is printed) // the help message is printed)
double tmptime = time(NULL);
srand((unsigned int) tmptime);
cerr << (unsigned int) tmptime << endl << endl;
cerr << unifrnd(2,2) << endl;
exit(1);
/*
options.add(fnin); options.add(fnin);
options.add(help); options.add(help);
options.add(xdim);
options.add(ydim);
options.parse_command_line(argc, argv); options.parse_command_line(argc, argv);
// line below stops the program if the help was requested or // line below stops the program if the help was requested or
...@@ -76,7 +80,7 @@ int do_work(int argc, char* argv[]) { ...@@ -76,7 +80,7 @@ int do_work(int argc, char* argv[]) {
}else{ }else{
// Call the local functions // Call the local functions
return do_work(argc,argv); return do_work(argc,argv);
}*/ }
}catch(X_OptionError& e) { }catch(X_OptionError& e) {
options.usage(); options.usage();
cerr << endl << e.what() << endl; cerr << endl << e.what() << endl;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment