Skip to content

Commit

Permalink
added scenarii column to lda file (0 is obs. data)
Browse files Browse the repository at this point in the history
  • Loading branch information
fradav committed Feb 9, 2021
1 parent f186647 commit 40c206f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/ModelChoice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,14 @@ ModelChoiceResults ModelChoice_fun(Reftable<MatrixType> &myread,
const std::string& lda_filename = outfile + ".lda";
std::ofstream lda_file;
if (!quiet) {
MatrixXd ldastatobs = statobs(all,lastN(data_extended.cols()));
MatrixXd toprint(n+ldastatobs.rows(),data_extended.cols());
MatrixXd ldastatobs = statobs(all,lastN(K-1));
MatrixXd toprint(n+num_samples,K-1);
toprint << ldastatobs, data_extended;
toprint.conservativeResize(toprint.rows(), toprint.cols()+1);
toprint.block(0,K-1,num_samples,1) = MatrixXd::Zero(num_samples,1);
for(auto i = 0; i < n; i++) toprint(num_samples+i,K-1) = myread.scenarios[i] + 1;
lda_file.open(lda_filename, std::ios::out);
lda_file << "# First lines (" << ldastatobs.rows() << ") are observed data" << std::endl;
lda_file << "# First lines (" << num_samples << ") are observed data" << std::endl;
lda_file << toprint << std::endl;
}
lda_file.close();
Expand Down

0 comments on commit 40c206f

Please sign in to comment.